Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question

5 Answers 5

up vote 3 down vote accepted

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.

share|improve this answer
1  
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. –  Peter John Acklam Nov 23 '11 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

EDIT:

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

or

usermod -s /usr/bin/bash diana
share|improve this answer
    
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 '11 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. –  Iain Nov 23 '11 at 9:04
    
@Diana thx lain now your answered on my question , sorry about my confusion question –  Diana Nov 23 '11 at 9:35
    
@Diana, have you read the message I sent you? don't make things worse by being rude. –  Chopper3 Nov 23 '11 at 9:52

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

setenv SHELL /usr/bin/bash
exec $SHELL

then to change it back you just change SHELL back to the default value. 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

share|improve this answer
    
@Diana Its fixed. –  Solignis Nov 23 '11 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 '13 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

share|improve this answer

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 ~]# 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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