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

Posted: September 2, 2014. At: 5:59 PM. This was 3 years ago. Post ID: 7697
Page permalink: http://securitronlinux.com/bejiitaswrath/how-to-change-the-shell-for-a-user-on-a-linux-system-easily-with-the-usermod-command/

Now, we must convince Congress to stop the FCC. Can you display an alert?

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.

homer@deusexmachina:~/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