Solaris UNIX: Change Default Shell

How do I change default ksh shell to bash shell under Solaris / OpenSolaris UNIX operating system using command line options?


You need to use passwd command to change your login shell under Solaris UNIX operating systems. Also, the passwd command changes the password or lists password attributes associated with the user’s login name. Additionally, privileged users can use passwd to install or change passwords and attributes associated with any login name.

Change Default Shell

Use the command as follows for normal user (assuming that you have rights:
$ sudo passwd -e username
$ sudo passwd -e vivek

Otherwise login as the root and enter:
# passwd -e root
# passwd -e vivek

You can also create a sudo entry for user called vivek to change his shell:
vivek ALL=NOPASSWD: /bin/passwd -e
Or all users in users group can changer their own shell:
%users ALL=/bin/passwd -e

πŸ₯Ί Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🀠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

3 comments… add one
  • MD Jul 7, 2011 @ 4:31

    All this does is expires the password

  • Saket Kale Jul 30, 2012 @ 8:55

    This does work(passwd -e) and the shell gets changed in Solaris,

  • Bruce Wayne May 14, 2013 @ 9:03

    I’m trying on solaris platform but I can’t edit the sudoers even using root account. Also Visudo doesn’t work. How to save sudoers as it is read only?

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.