Safely change the Solaris superuser login shell

Home -> UNIX -> Solaris -> System administration

26308 views

From the computer of: qmchenry (338 recipes)
Created: Oct 05, 2003


1 comments:
View all comments

Add a comment

Add to:
Add to stumbleuponAdd to del.icio.usDigg itAdd to FURL

The default login shell for the Solaris superuser root is /sbin/sh, a statically linked Bourne shell. This shell is not dependent on any other files to run. The usual user shells like /usr/bin/ksh are dynamically linked and are dependent on library files. If the root login shell is changed from /sbin/sh to a non-static shell, root will not be able to log into the system if certain filesystems cannot mount. A simple addition to root's /.profile will change the shell safely.

To change the root shell to Korn shell at login if the file /usr/bin/ksh exists, add the following lines to the end of the root user's profile (usually /.profile):

if [ -x /usr/bin/ksh ]; then
    SHELL=/usr/bin/ksh
    export SHELL
    exec /usr/bin/ksh
else
    echo /usr/bin/ksh not found using default shell of $SHELL
fi


Make certain that the login shell for root in /etc/passwd is /sbin/sh.

Subscribe to the Tech-Recipes Newsletter

You can get tips like this delivered in your email every week!

Enter your Email

We will never, ever sell your email address or spam you.




1 Recipe comments: View comments

When NOT to be in another shell... by Anonymous



Related recipes:

  Add a user from the command line in Solaris
  Change a user password in Solaris
  Configure unique MAC addresses on multiple interfaces
  Login to Solaris desktop from Windows using Cygwin
  Use BackSpace Key to Erase characters instead of Delete Key
  Solaris: Create a mount point
  Solaris 10: connect or login to zone console
  Set the ethernet MAC address in Solaris
  Change BootPROM settings from the Solaris command line
  Remove or backout patches in Solaris

 

Sponsored links

 

Login

Nickname

Password

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.