Managed Services - How to set a customer's password with Sudo

Last Updated: 04/03/2017
Back to:
One Column
Two Column


When a customer's account is first created or if someone forgets his/her password, you may need to reset it. Follow the steps below to reset a customer's password on your server.

This tutorial applies to the following operating system(s):
  • MAC

1. Gather the information

You must know the username of the customer. The username "buffalor" for Ralphie Buffalo will be used for the purposes of this tutorial. Substitute the real username where appropriate. Chip Buffalo, with the username "buffaloc" will be used as a replacement for your username.

Determine on which server the customer has an account.

You will need "sudo" access on the server to set a user's password. If you do not, or are unsure, contact MS&C/UnixOps at trouble@<machinename>, where <machinename> is the server in question. The server "mailserver" will be used as an example in this tutorial.

2. Log in and ensure the account exists

Make sure the customer has an account on your server. Log into your server with an ssh client using a command similar to the one below. Note that this is not necessarily the machine the customer was working on but its server. You do not need to have an X server running.

Visual representation of the step above.

You should now have a command prompt on the server.

Visual representation of the step of above.

Run the command "finger" followed by the username of the customer to see if he/she has an account. If finger returns "no such user", he/she does not have an account. Otherwise finger will return the account details. You can create an account if necessary using adduser.

.Visual representation of the step of above.

3. Reset the password

Reset the customer's password by running "passwd <username>":

Visual representation of the step above.

It will prompt you first for your sudo password, then twice for the customer's new password.

4. Have the customer change his/her password

The customer should now be able to his/her account using the password you set. DO NOT E-MAIL THE NEW PASSWORD TO THE CUSTOMER. He/she can change his/her password by running the command "passwd" at a command prompt on the server. Note this is not run with sudo.

Visual representation of the step above.

It will prompt once for the previous password and twice for the new one.

The customer's password is now properly reset.

Back to top