≡ Menu

chsh command

CentOS / RHEL: Install KornShell (KSH)

I am porting ksh script from Sun/Oracle Unix to Linux. How do I install ksh (KornShell) in CentOS / Fedora / Red Hat Enterprise Linux? How do I run and test ksh script on RHEL/CentOS Linux?
[click to continue…]

FreeBSD: Install zsh Shell

How do I install the Z shell ( zsh ) shell under FreeBSD 9 operating systems?
[click to continue…]

Debian / Ubuntu Linux: Install KornShell (KSH)

I am porting ksh script from Sun/Oracle Unix to Debian / Ubuntu Linux based server hosted on AWS cloud. How do I install ksh (KornShell) in Debian or Ubuntu Linux server? How do I run and test ksh scripts?
[click to continue…]

Linux / UNIX: Change Bash To KSH Shell

How do I change my current login shell from bash to ksh under Linux or UNIX or Apple OS X operating systems?
[click to continue…]

Linux Disable Shell / FTP Access For a User Account

My users will only be checking mail, and I want to disable FTP access as well as shell access under CentOS Linux. How do I disable shell (SSH) and FTP access to a new or old user under Linux without deleting user account?
[click to continue…]

FreeBSD Install BASH Shell

I'd like to Bash shell under FreeBSD for bash programming. How do I install bash shell under FreeBSD UNIX operating system?
[click to continue…]

OpenBSD Install BASH Shell Package Command

How do I install BASH shell package under OpenBSD operating system? How do I set bash as a default login shell under OpenBSD?
[click to continue…]

Howto: Changing Linux Login Shell

Q. Can you tell me command to change login shell in Linux / UNIX operating system?

A. You don't have to edit /etc/passwd file to change your shell. You need to use chsh command. It changes the user login shell. This determines the name of the users initial login command. A normal user may only change the login shell for his/her own account, the super user i.e. root user may change the login shell for any account. Following is syntax of chsh command:
chsh -s {shell-name} {user-name}


  • -s {shell-name} : Specify your login shell name. You can obtained list of avialble shell from /etc/shells file.
  • User-name: It is optional, useful if you are a root user.

First, find out available shell list:
$ less /etc/shells



Now change your shell name to /bin/tcsh:
$ chsh -s /bin/tcsh

When promoted for password, type your own password. If you just type chsh command, it will prompt for shell name interactively:
$ chsh


Changing the login shell for tv
Enter the new value, or press ENTER for the default
       Login Shell [/bin/bash]: