CyberTutorials.org - chsh - Change Shell

We will be stepping through a process which sets a user’s shell in Kali Linux from /bin/bash to /usr/bin/zsh.

First, we add a user.

Copy to Clipboard

Use “getent” to get the entry from the passwd file for the new user.

getent is a Unix command that helps a user get entries in a number of important text files called databases.

Wikipedia.org

Copy to Clipboard

Switch user (su) to the new user account and echo the $SHELL variable.

Copy to Clipboard
Copy to Clipboard

Use “chsh” to change the new user’s shell.

chsh (an abbreviation of “change shell”) is a command on Unix-like operating systems that is used to change a login shell.

Wikipedia.org

Copy to Clipboard

Use “CTRL + D” to logout the new user. The shell will update on next login.

Switch user (su) to the new user account that will now utilize “zsh”.

Copy to Clipboard

Now verify that the shell has changed using echo.

Copy to Clipboard
Jesse Shelley