Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I disable and change the user password using SSH on a Linux

share|improve this question

Login with the root account, and type: passwd otheraccount hit enter. replace otheraccount with the account name of the user you want to have the password changed.

share|improve this answer

You don't. You perform the actions on the underlying system user via passwd.

share|improve this answer
right, once I login as admin, how do I go about doing it? – Jean Oct 5 '10 at 7:54
With the passwd command. See the passwd(1) man page for details. – Ignacio Vazquez-Abrams Oct 5 '10 at 7:55
not for the user login but for an alternate user – Jean Oct 5 '10 at 7:58
As the man page says, you can specify an alternate user for passwd to use. – Ignacio Vazquez-Abrams Oct 5 '10 at 7:59

You have a few options, somewhat dependent on what you mean by "disable". For the purposes of this explanation I will use the string foo as a placeholder for the account name in question.

You cannot disable an account, per se, without deleting it wholesale, however, deactivating the account password passwd --inactive 0 foo will effect a similar functional change.

The closest to what I believe to be your objective would be to lock the account, passwd -l foo which changes the password to an unknown, encrypted value.

Another option, although not immediately apparent perhaps, is to delete the account. This will likely be performed with the userdel foo command, depending on your particular operating system. userdel will, by default, not delete any files owned by the user but will remove the account itself from the system account files. Be careful when exercising this option, however, as it can adversely affect cron execution and other automated processes if execution normally occurs as the deleted user.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .