Unix Manuals

Changing your password

NOTICE - New forum for all UNIX learners, users and programmers - click here

You should change your UNIX or Linux password regularly, and the system may even force you to change it from time to time. Also, is likely that it will ask you to change it when you first use your user ID (if so, you will go straight to step 4 below). You may like to read the tutorial Choosing a password before continuing with this document.

To change your password on UNIX or Linux systems, follow these steps:

  1. Log into the system using your old password, if you are not already logged in.

  2. At the prompt, use the command:

    $ passwd

  3. Usually, you will be asked to enter your old password first. This is a security measure, designed to help prevent someone else from changing your password:

    $ passwd

    Enter old password:

    Note that when you enter your old password, it will not be displayed.

  4. (Note that, if you are being forced to change your password as part of logging in, you will come straight to this stage). You will be asked to enter your new password:

    $ passwd

    Enter old password:

    Enter new password:

    Note that when you enter your new password, it will not be displayed. Choosing a good password is not as simple as just thinking of a word - for a useful guide, have a look at Choosing a password.

  5. You will then be asked to re-enter your new password. This is designed to make sure that you did not make any typing mistakes when typing your new password:

    $ passwd

    Enter old password:

    Enter new password:

    Re-enter new password:

  6. You should then be informed that the change has been successful, and be returned to the prompt:

    $ passwd

    Enter old password:

    Enter new password:

    Re-enter new password:

    Password updated successfully.

    $

    (Note that if you are changing your password as part of the log on procedure, the log on procedure will continue now).

    If anything goes wrong (for instance, when you entered the password twice, there was a mismatch), you will be notified, and the password will remain unchanged. You may be given the option of trying again.

    If all went well, your new password is now in effect, and your old password will no longer work.

Home