1826657 Members
2416 Online
109695 Solutions
New Discussion

Re: login shell

 
SOLVED
Go to solution
Oliver Schmitz
Regular Advisor

login shell

Dear all,

how can I define the default startup shell of a user. I saw that it is possible when I create a new user with sam. How can I do it afterwards?

Can I define every shell installed?

Thanks ,

Oliver
Oliver Schmitz
6 REPLIES 6
Jeff Schussele
Honored Contributor

Re: login shell

Hi Oliver,

The default shell is defined in the last (7th) field of the users entry in the /etc/passwd file.
You can use vipw to safely edit the passwd file or use SAM to modify the user.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Pete Randall
Outstanding Contributor
Solution

Re: login shell

Oliver,

As you've noted, you can do it in SAM when adding the user. You can also do so with "useradd -s" when adding the user. To change the shell afterward, the easiest way would be to use vi (or perhaps sed) on the /etc/passwd file.


Pete


Pete
Bernhard Mueller
Honored Contributor

Re: login shell

Oliver

it is defined by the last field in /etc/passwd. You can use any shell.
You can use any shell, can also use a script that is run upon login...

Regards,
Bernhard
Pete Randall
Outstanding Contributor

Re: login shell

Oliver,

One other thought: If you're going to be changing shells, make sure the shell you've chosen is listed in /etc/shells. If you don't have /etc/shells, create it and add the shell to it. Here is a basic /etc/shells:

$ more /etc/shells
/bin/sh
/bin/rsh
/bin/ksh
/bin/rksh
/bin/csh
/bin/pam
/usr/bin/keysh
/bin/posix/sh
/sbin/sh
/usr/bin/sh
/usr/bin/rsh
/usr/bin/ksh
/usr/bin/rksh
/usr/bin/csh
/usr/bin/keys


Pete


Pete
Umapathy S
Honored Contributor

Re: login shell

Oliver,
The 7 column corresponds to the shell which is invoked when the login successfully completes authentication.
/usr/bin/sh is the default shell. You can choose also /usr/bin/ksh.

When adding users through SAM you can see this option.

If you want to change that for a particular user
usermod -s

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Patrick Wallek
Honored Contributor

Re: login shell

One thing to note if you do change users' shells --- *DO NOT EVER* change the default shell for root. It *MUST* be /sbin/sh. If it is anything else you rish an unbootable server.