LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-12-2007, 05:17 PM   #1
Rostfrei
Member
 
Registered: Aug 2005
Location: Slovenia
Distribution: Fedora, Ubuntu
Posts: 69

Rep: Reputation: 15
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,
 
Old 06-12-2007, 05:22 PM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
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.
 
Old 06-12-2007, 05:37 PM   #3
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
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.
 
Old 06-12-2007, 05:52 PM   #4
Rostfrei
Member
 
Registered: Aug 2005
Location: Slovenia
Distribution: Fedora, Ubuntu
Posts: 69

Original Poster
Rep: Reputation: 15
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,

Last edited by Rostfrei; 06-12-2007 at 05:55 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 11:30 AM
Installing .bin-files, leave the file in /usr/local/bin/ ? lagu2653 Linux - Software 1 11-08-2005 09:30 PM
Is '/usr/bin/find' reliable if '/bin/ls' has been replaced? DigaMe Linux - Security 2 11-12-2004 11:42 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 03:30 AM
Newbie needs help Installing j2sdk-1_4_2-nb_3_5_1-bin-linux.bin bendoku Linux - Newbie 5 10-11-2003 10:27 AM


All times are GMT -5. The time now is 09:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration