ObjectiveThe objective is to change a user password on Ubuntu 18.04 Bionic Beaver Linux
Operating System and Software Versions
- Operating System: - Ubuntu 18.04 Bionic Beaver Linux
RequirementsPrivileged access to your Ubuntu System as root or via
sudocommand is required.
- # - requires given linux commands to be executed with root privileges either directly as a root user or by use of
- $ - requires given linux commands to be executed as a regular non-privileged user
Change password using Command LineIn the first example we will be changing password for the currently logged in user
passwdcommand. No special privileges are required.
passwdcommand with no additional options or arguments will change the password for the current logged in user. Open up terminal and enter:
$ passwdPlease note that you will be prompted to enter your current password first after which you will be required to enter and retype your new password. You will not be able to see the password you are typing on the terminal. However, the terminal is reading your keyboard input regardless, so just keep typing.
Using the next example we will change the password for a different user called
john. In this case we need to use the
sudocommand and specify the user's name for whom we wish to change the password:
$ sudo passwd john
After executing the above
passwdcommand you will be first asked to enter your current administrative sudo password, followed by the new user password.