I have Solaris machine , by default tcsh is the shell

How to change the default shell to bash, for example - after log out and login again I will have the bash in place the tcsh!

I mean after log out and log in by ps command I will see bash and not tcsh ,

   my_solaris:/ ROOT > ps
   PID TTY         TIME CMD
   13950 pts/4       0:00 ps
   9951 pts/4       0:00 tcsh

5 Answers 5


You can change the login shell that has been set for your account with the usermod command.

usermod -s /usr/bin/bash diana

Double check the path of the bash shell on your machine with which bash.

Note that the usermod command requires root privileges.

  • 2
    Not only double-check, but also run the shell, to make sure that there are no missing dynamic dependencies (which I have experienced). At least do /usr/bin/bash --version. Nov 23, 2011 at 9:44

You can use the exec command to execute a program in place of your current shell which terminates. To change your shell to bash you can use

exec bash

will switch your shell to bash

exec tcsh

will switch it back again


Now that you have changed your question to mean something different the answers will be different

You will need to have root access to do this but either of the following should work

passwd -e diana 
Old Shell: /usr/bin/tcsh
New Shell: /usr/bin/bash
passwd: password information changed for diana


usermod -s /usr/bin/bash diana
  • see my update - you solution is temp solution , after log out and log in I need to see bash and not tcsh
    – Diana
    Nov 23, 2011 at 9:01
  • 5
    You should be able to figure out how to do that yourself it's incredibly basic shell administration. I've said it before but I'll say it again. You really need to speak to your manager about some very basic unix education.
    – user9517
    Nov 23, 2011 at 9:04
  • @Diana thx lain now your answered on my question , sorry about my confusion question
    – Diana
    Nov 23, 2011 at 9:35
  • @Diana, have you read the message I sent you? don't make things worse by being rude.
    – Chopper3
    Nov 23, 2011 at 9:52

For Solaris 11 (and Solaris 10), as root you can do the following

[root@server ~]# passwd -e other_user
Old shell: /usr/bin/bash
New shell: /usr/bin/ksh
passwd: password information changed for other_user
[root@server ~]# 

I think this is what you are looking for.

How to change Solaris shell

You should read some of the comments they mention important things.

What it looks like you need to do is mess with the environment vars a little in your ~/.profile

setenv SHELL /usr/bin/bash
exec $SHELL

then to change it back you just change SHELL back to the default value. This works for csh and ksh. It may even to do this on reboot I am not sure.

As read further into the page, I see someone talking about adding the above commands into a file called ~/.cshrc

  • @Diana Its fixed.
    – ianc1215
    Nov 23, 2011 at 8:43
  • It appears the user "owns" the machine in question, and shouldn't have to resort to backwards-tactics. An "official" way to change the shell should be possible as root.
    – Signal15
    Sep 5, 2013 at 20:21

In addition to what was previously noted : usermod -s /usr/bin/bash USERNAME ....

You can also change the default shell for new accounts by using useradd -D

useradd -D -s /usr/bin/bash

REFERENCE: http://docs.oracle.com/cd/E19963-01/html/821-1462/useradd-1m.html

Not the answer you're looking for? Browse other questions tagged or ask your own question.