Hw to Change the User's Shell in AlmaLinux
usermod command.Categories:
less than a minute
Introduction (30 seconds)
Hello everyone. Welcome to my channel! Today, I will show you how to change the user’s shell in AlmaLinux.
Changing the User’s Shell
To change the user’s shell, you can use the usermod command followed by the -s option. For example, to change “john_doe”’s shell to /bin/zsh, you would run:
But first, let’s check the current shell of “john_doe”:
getent passwd john_doe
The output should be similar to the following:
john_doe:x:1001:1001::/home/john_doe:/bin/bash
First we should also check if the zsh is installed:
ls /bin/zsh
If the shell is installed, you can proceed to change it.
But if it is not installed, you can install it using the following command:
sudo dnf install zsh
Now, let’s change the shell:
To change “john_doe”’s shell to /bin/zsh, you would run:
sudo usermod -s /bin/zsh john_doe
We should verify the change by checking the user’s details again:
getent passwd john_doe
The output should now show /bin/zsh as the shell:
john_doe:x:1001:1001::/home/john_doe:/bin/zsh
Conclusion (30 seconds)
If you found this tutorial helpful, please like and subscribe for more Linux administration videos. Drop any questions in the comments below!
Thanks for watching!
Optional Thumbnail Text Ideas
- How to Change the User’s Shell in AlmaLinux
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.