Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Is it possible to remove users password on ubuntu? The user only needs access through ssh and he can use key file authentication so he doesn't need the password anymore. I'd rather not disable logging through ssh with passwords completely, just remove the password for this user. When creating access for new users to the computer I like to set up a password for them until they can setup their ssh key.

The computer is ubuntu 8.04

share|improve this question
up vote 5 down vote accepted

try usermod's -L flag:

-L, --lock

Lock a user's password. This puts a '!' in front of the encrypted password, effectively disabling the password. You can't use this option with -p or -U.

share|improve this answer
passwd -l does the same thing, additionally. – Daenyth Jun 23 '10 at 13:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.