On a default SUSE Linux installation, ordinary users are able to change their passwords at the shell. In fact, under SUSE Linux 9.1, as supplied with this book, using shell commands is the only way users can change their password, because there's no GUI tool that will do this job.
The command to change the user's password is simple:
The user will be asked to confirm his current password, and then to enter the new password twice, to confirm that it's been typed correctly.
There are various rules imposed on the creation of new passwords. For example, passwords over eight characters won't be accepted, and passwords that are too short also won't be accepted. If the user breaks any of these rules, she will be told at the command prompt and allowed to try again, as shown in Figure 30-2. Up to three attempts can be made before the program will quit.
Figure 30-2. Ordinary users can change their own passwords, but there are rules on size and style.
The root user can use the passwd command to change anyone's password, as well as various other aspects relating to the user's login. All that's needed is to specify the user whose password is to be changed:
In this case, you won't be asked to enter the old password, because the user himself might have changed it. Instead, you'll simply be asked to enter the new password.
Just as when a regular user changes a password, the root user will see warnings if a password is too long, too short, or violates any of the other rules. However, the root user can override these warnings by simply retyping the password and thereby forcing it through.
A number of command options can be specified along with the passwd command when it is run as root user. For example, the -l option will lock the account so that it can't be accessed (the -u option will unlock it). The -e option will force the specified user to change his/her password the next time he logs in. He will be prompted to enter his old password and then told to choose a new one.