Ubuntu issues with $BASH_VERSION and new user

1

I'm logging into my new Ubuntu VPS via SSH from a terminal in Ubuntu desktop. I have created a new user adam, which I've added to the sudo group, so I don't have to log in as root all the time. When I login as root everything is as expected, except when I login in as adam I'm having some issues with the $BASH_VERSION environment var.

I've not changed anything within the default .profile and .bashrc files, so I should have all the default settings. I noticed though in .profile there is a condition around including .bashrc:

if [ -n "$BASH_VERSION" ]; then

Except when I echo $BASH_VERSION from the CL I get nothing back, just an empty line. Something seems really screwed here but it's just a little beyond my knowledge.

Incase it's useful, here's what I used to create the user:

useradd -d /home/adam -m adam
sudo passwd adam
usermod -a -G sudo adam

Adam

Posted 2013-04-04T10:15:27.547

Reputation: 115

Answers

2

The default shell equivalent of /bin/sh on Ubuntu is /bin/dash, not /bin/bash. Check your shell.

choroba

Posted 2013-04-04T10:15:27.547

Reputation: 14 741

Awesome! I don't quite understand why it wasn't set to the correct value to start with, but you set me on the right track. Although /bin/dash didn't work, /bin/bash did. – Adam – 2013-04-04T10:33:55.227

1

I ran into the same problem. To fix it do:

sudo chsh -s /bin/bash adam

Balthasar

Posted 2013-04-04T10:15:27.547

Reputation: 21

2Hi Balthasar. Welcome to the Stack Exchange network! The first part of your answer is correct but you were probably downvoted because the second part is unclear / incorrect; useradd -D (by itselft) simply prints the default useradd configuration. It would be best to edit your answer to improve it. – Anthony Geoghegan – 2015-06-09T10:33:37.393