Would you like to learn how to change the user password using a Shell script on Ubuntu Linux? In this tutorial, we are going to show you how to create a user account and change its password using a shell script on Ubuntu Linux.

• Ubuntu 18.04
• Ubuntu 19.10
• Ubuntu 20.04

Ubuntu Playlist:

On this page, we offer quick access to a list of videos related to Ubuntu Linux.

Don’t forget to subscribe to our youtube channel named FKIT.

Ubuntu Related Tutorial:

On this page, we offer quick access to a list of tutorials related to Ubuntu linux.

Tutorial Ubuntu – Change the user password using Shell script

Create a new user account.

Copy to Clipboard

Set the password to the user account.

Copy to Clipboard

Try to login using the new credential.

You can automate this process using a shell script.

Create a shell script.

Copy to Clipboard

Here is the file content.

Copy to Clipboard

Set the correct file permission.

Copy to Clipboard

Test the Shell script.

Copy to Clipboard

Try to login using the new credential.

Here is an improved version of the same script.

Copy to Clipboard

Test the Shell script.

Copy to Clipboard

In our example, we created a user account named Yamcha and set the password 123qwe.