How to change the shell for a user on a Linux system easily with the usermod command.

I recently created a new user with the adduser command.

homer@deusexmachina:~/Documents$ sudo adduser jimkirk
Adding user `jimkirk' ...
Adding new group `jimkirk' (1002) ...
Adding new user `jimkirk' (1002) with group `jimkirk' ...
Creating home directory `/home/jimkirk' ...
Copying files from `/etc/skel' ...
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully
Changing the user information for jimkirk
Enter the new value, or press ENTER for the default
	Full Name []: 
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
Is the information correct? [Y/n] y

Now I wanted to change the users shell. I used the usermod command to change this.

[email protected]:~/Documents$ sudo usermod -s /bin/sh jimkirk

Now the user has a different shell. This is an easy way to change your own shell as well as modifying another user on your computer system.

homer@deusexmachina:~/Documents$ sudo grep /bin/sh /etc/passwd
libuuid:x:100:101::/var/lib/libuuid:/bin/sh
speech-dispatcher:x:110:29:Speech Dispatcher,,,:/var/run/speech-dispatcher:/bin/sh
jimkirk:x:1002:1002:,,,:/home/jimkirk:/bin/sh
1 responses to “How to change the shell for a user on a Linux system easily with the usermod command.

Leave a Reply