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?

ADVERTISEMENTS

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

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
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.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.