The passwd CommandAs covered in the first lesson, it's imperative that you have a set of credentials in order to log in to a Unix system. Credentials consist of a username (usually assigned to you by your Unix system administrator) and a password. Although the password is generally configured by the system administrator, you can change it yourself. More specifically, if your machine is not connected to a network with other Unix computers, then you can use the passwd command to change your password.
To use the passwd command, you must first have the proper privileges to make a change. If you are not a SuperUser (su), passwd will first prompt you for your current password just to make sure you are who you say you are (this is a security measure implemented to protect your credentials), and Unix will not continue unless the correct password is entered. After you enter your current password, you will be asked for your new password, as shown in the following example: >passwd Changing password for rob Old password: ***** New password: ****** Retype new password: ****** Password successfully changed
The passwords you type are not shown on your display as you type them; this way, if someone is looking over your shoulder, they cannot see what you type, and Unix offers no clues to your would-be attacker. In this example, asterisks (*) are used to indicate that typing has taken place. If the password change is successful, Unix indicates that with a message such as, "Password successfully changed." If not, you will see another message, most likely "Authentication Failure" if you did not supply the correct credentials needed to successfully change your password. In some cases, Unix can keep you from choosing certain passwords if they are too short or based on words in Unix's built-in dictionary file. If your Unix machine is set up this way and you enter an unacceptable password, the passwd command usually tells you what you need to do to correct it. Choose passwords that mix letters, numbers, and letter cases and that are not based on common words. |