-s: Specify the login shell for the user. Linux Commands – Overview with Examples and FAQs

Introduction

The Linux command -s is used to specify the login shell for the user. This command is used to set the default shell for the user when they log in to the system. It is important to note that the login shell is different from the user’s current shell. The login shell is the shell that is used when the user logs in to the system, while the current shell is the shell that is used when the user is currently logged in. The -s command allows the user to specify which shell they would like to use as their login shell.

Examples

Example:

To set the login shell for the user ‘john’ to bash, run the following command:

chsh -s /bin/bash john


The chsh command is used to specify the login shell for a user in Linux. This command is used to change the user’s login shell, which is the program that is executed when the user logs in. The login shell is typically set to /bin/bash, but it can be changed to any other valid shell. To change the login shell for a user, use the following command:

chsh -s /path/to/shell username

Replace /path/to/shell with the path to the desired shell, and username with the username of the user whose login shell is to be changed. For example, to change the login shell for the user john to /bin/zsh, use the following command:

chsh -s /bin/zsh john

Once the command is executed, the user’s login shell will be changed to the specified shell. The user will need to log out and log back in for the change to take effect.

Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Jassweb.com/

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.

Contact
Jassweb, Rai Chak, Punjab, India. 143518