LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   userad and /bin/sh problem (https://www.linuxquestions.org/questions/linux-newbie-8/userad-and-bin-sh-problem-561290/)

Rostfrei 06-12-2007 04:17 PM

userad and /bin/sh problem
 
Hello!

I installed Ubuntu 7.04 Server edition. Everything is ok, I created one user account during instalation as Ubuntu have root user disabled by default! Now I want to add some users. I added a user with

Code:

sudo useradd -m some_user
passwd some_user
.
.
.

I checked the /home/some_user directory and files were copied from the /etc/skel directory.

Code:

.bash_logout
.bashrc
.profile

Now I can login to my new user account but nothing of the following works (and maybe more):
- command completion (TAB); instead of command completion I get real tab space
- command history (up/down keys); now my cursor goes up and down the screen

All this things works on my primary account that was created during install. Why? I checked and the owner of every .bash* file is some_user. It seems as .bash* files are not read or there is something else?

Best regards,

reddazz 06-12-2007 04:22 PM

Is your shell /bin/sh or /bin/bash? If its /bin/sh then you probably won't have the fancy features like tab completion and history.

dxqcanada 06-12-2007 04:37 PM

Look at the /etc/passwd file for the user.
The last field represents the shell to spawn for that user ... like Reddazz mentioned ... you probably want /bin/bash.

The -s switch for useradd specifies the shell.

See the man page.

Rostfrei 06-12-2007 04:52 PM

Thank you both very much! You were right. I checked the /etc/passwd and some_user had /bin/sh instead of /bin/bash as its shell.

I used command

Code:

sudo usermod -s /bin/bash some_user
and now everything works ok! Fist of all I didn't know which of the shells enables tab completion and all those fancy features. Then I checked the defaults for useradd with

Code:

useradd -D
and I saw that the default for SHELL=/bin/sh. This default behavior can be changed with command

Code:

sudo useradd -D -s /bin/bash
More on this topic can be found on http://www.debianhelp.co.uk/userandgroup.htm or man pages.


Best regards,


All times are GMT -5. The time now is 02:17 PM.