How to remove users password on ubuntu

5,129

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:
5,129

Related videos on Youtube

palto
Author by

palto

Updated on September 18, 2022

Comments

  • palto
    palto over 1 year

    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

  • Daenyth
    Daenyth almost 14 years
    passwd -l does the same thing, additionally.