Command Line Basics: Change Your Password
Hopefully by now you understand the need to have a strong password for your computer login. Perhaps you selected your password when you first installed GNU/Linux and you've never changed it. Maybe you don't even know how to change it. Today I'll show you how to change your password from the command line.
Now you may be asking, isn't there a way I can do this through one of the system menus? Of course there is. The problem is, it's one way on Gnome, another way on KDE, yet another way on XFCE, etc., etc., etc. For me it's simpler to just open a terminal window and I can change my password, regardless of what desktop manager or window manager I'm using.
So without further ado, open up a terminal window and enter the command
The system will first prompt you for your current UNIX password. (I'm not sure why is mentions UNIX during this operation. I suspect it is from the legacy of the GNU tools being a reverse engineering of Unix.) At any rate, this prompt just means to enter your current password. After that you'll be prompted to enter a new password. You'll then be prompted to enter your new password one more time for verification.
And that's all there is to it. Your login password has now been changed.