If you’ve forgotten your password, you’ll need to ask your system administrator for help.

Forgetting passwords happens most often on a new account or on an account you don’t use very often.

If this happens to you...sorry, our bag of tricks is empty. There isn’t anything else you can do except ask your administrator to assign you a new password (which you’ll be expected to change as soon as possible).

(Your administrator can’t just tell you what your password was. Passwords are encrypted, so they are impossible to recover.)

When you’re assigned a new password, log in with it, and then change your password to one that only you know. Change your password with the passwd command. The passwd command first prompts you for your old password and then asks you for the new one. It asks you for the new password twice, to make sure that you haven’t made a typo. For example:

% passwd
Changing NIS password for lmui on ruby.
Old password: [type current password]
New password: [type new password]
Retype new password: [repeat new password]
NIS entry changed on ruby

The passwd command doesn’t show the password as you type it, so that people looking over your shoulder won’t see it.

Here’s a bit of computer etiquette: respect the passwords of your friends and coworkers. Don’t try to look over people’s shoulders when they type their passwords, and don’t be shy about asking them to look away while you type your own.

Get WYNTK: UNIX System Admininistrator now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.