O'Reilly logo

The Linux Command Line by William E. Shotts Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing Your Password

The last topic we’ll cover in this chapter is setting passwords for yourself (and for other users if you have access to superuser privileges). To set or change a password, the passwd command is used. The command syntax looks like this:

passwd [user]

To change your password, just enter the passwd command. You will be prompted for your old password and your new password:

[me@linuxbox ˜]$ passwd
(current) UNIX password:
New UNIX password:

The passwd command will try to enforce use of “strong” passwords. This means it will refuse to accept passwords that are too short, are too similar to previous passwords, are dictionary words, or are too easily guessed:

[me@linuxbox ˜]$ passwd (current) UNIX password: New UNIX password: BAD PASSWORD: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required