chsh provides the -s option to change the user’s shell. In the above commands, replace nishant with the user name whose shell has to change.Ĭhsh is the utility to change a user’s login shell. With usermod command mention shell and username after –shell option. We are going to change the shell from /bin/sh to /bin/bash of user nishant using usermod command. In this example, we are going to change the shell of a user named nishant. usermod command provides the -s or –shell option to change the user’s login shell. usemod can change the shell of Users by modifying file /etc/passwd. Usermod is a command that modifies the system account files. Changing default sh shell to bash Using usermod command If an account has a restricted login shell, then only the root can change that user’s shell.The root account can be used to change any other user login shell.Users can change shell to any other shell listed in /etc/shells/.
We can check installed shells using the following command : cat /etc/shellsīefore moving further, first understand who can change the user shell Now to change the shell, first, we need to see which shells are installed on the system.
How to Install and Set up Android Studio on Windows?.How to Change the Theme of Netbeans 12.0 to Dark Mode?.How to Install and Use Metamask on Google Chrome?.How to Install and Run Apache Kafka on Windows?.How to install requests in Python - For windows, linux, mac.How to integrate Git Bash with Visual Studio Code?.How to filter object array based on attributes?.How to Connect Two Computers with an Ethernet Cable?.How to setup Anaconda path to environment variable ?.How to set up Command Prompt for Python in Windows10 ?.How to set fixed width for in a table ?.How to Install OpenCV for Python on Windows?.How to Check Incognito History and Delete it in Google Chrome?.Different Ways to Connect One Computer to Another Computer.How to install Jupyter Notebook on Windows?.How to Find the Wi-Fi Password Using CMD in Windows?.