Quick shell change for user in Unix or Linux

In order to change shell for a particular user of Unix/Linux system without editing /etc/passwd file manually just use command:

chsh -s /path/to/shell username

for example, to change shell to ’sh’ from ‘bash’ for user ‘viper’, use command:

chsh -s /bin/sh viper

 
 
» You might also be interested in the following articles:
Local and remote X sessions on different consoles
Why use SUDO instead of SU?
Can’t find usable shell script encryption solution…
Two-way conversion of Unix time (seconds since 1970) and regular time
Secure shell (ssh) session timeout



» Want to stay up to date? Subscribe to our E-MAIL or RSS feed!

3 Responses to “Quick shell change for user in Unix or Linux”


  1. 1 Wouter den Dulk

    Hi,
    One can also sudo vim /etc/passwd
    and change the shell column from sh to bash
    or anything else and then :wq

  2. 2 Rob Rasner IMDB

    Sup we found this Quick shell change for user in Unix or Linux – Linux * Screw entry very worthwhile and so we have included an trackback to it on our web site, keep up the great work:) All the best … Rob Rasner IMDB

  1. 1 Quick shell change for user in Unix or Linux « Linux Admin Blog

Leave a Reply




Friendly Sites:Who is behind Linux Screw?
GeekyBits³ | Bash Cures Cancer | OMG! Ubuntu!
My SysAd Blog | Web Upd8
ZEPY | Linux config Wiki | Planet Sysadmin
a non-geek's linux notes | Linux Today
TuxArena: The arena of Tux | LinuxAlt.Com
My name is Artem N. (artiomix AT gmail DOT com) and I'm Linux/Unix, Cisco systems engineer. The main idea of Linux Screw is to share relevant knowledge, skills and observations over The Web. Here you can find a lot of information related to different Linux distributions, FreeBSD, IOS as well as a other Open Source around staff. Read more ››