Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding a new user

Status
Not open for further replies.

joephilip

MIS
Apr 29, 2002
41
US
I want to add a new user. I want to use the shell as ksh. When I did 'which ksh", I got:
/usr/bin/ksh

I am planning to add the user like this:

useradd -u 901 -c "PS User" -d /home/pshrms -m -s /usr/bin/ksh -g dba pshrms


When I looked at other users, lots of them have /sbin/sh as their shell. When i did "which sh", it says /usr/bin/sh. So, why are they created with /sbin/sh?

Thanks,

Joani Tamminen
 
There are several shells.

Bourne shell (sh), Posix (also sh), Korn (ksh) c shell (csh), born again shell (bash) and others.

Whichever one you use is usually just down to personal preference.

The system administrator would normally select his / her own preference when setting up new users, but individual users may ask for their own preferred shell.

Remember that after logging in to your default shell, a user can switch to another preferred shell if they wish by entering the sh, csh, ksh etc at the command line.
 
"which" report the first found path of sh....

In your case, /usr/bin was placed ahead of /bin in your $path

BTW, /bin is a sym link to /usr/bin....
 
I am still confused. What is this /sbin ? Is it the same as /bin.

Joani Tamminen
 
As I understand it, sbin exists because should you only be able to mount the root (/) partition, you would not have access to the /usr/bin filesystem/directory and would therefore not be able to login as no shell would be available from /usr/bin, whereas sh is available in sbin, part of the root filesystem. Any better?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top