I have a user without a password set (i.e. passwd -d).

I would not like to use public keys on this setup.

Is there a way to SSH login to such a user?

  • do you want to login as that user, or do you want to be sure that no one else logs in as that user?
    – Baarn
    Jan 29, 2012 at 17:45

3 Answers 3


PermitEmptyPasswords yes then restart sshd ?

  • 2
    This works, but is horribly insecure. Jan 31, 2012 at 12:31
  • 1
    For sure, but well, as said : I would not like to use public keys on this setup. Jan 31, 2012 at 16:43
  • 4
    With Ubuntu 13.10 PermitEmptyPasswords yes doesn't let the user with an empty password set login, even after a reboot.
    – Pro Backup
    Feb 12, 2014 at 6:42
  • 12
    @ProBackup you'll have to add ssh to /etc/securetty for this to work.
    – Ruslan
    Nov 29, 2017 at 19:16

Allow PermitEmptyPasswords in sshd_config and restart sshd.


If you just want to become the user in question, the simplest way is to log in as some other user (via ssh) and su $username. This requires root privilegies, but you could put the command in /etc/sudoers and only let your user execute that command as root.

If you really want to login through ssh (or remotely in some other way), you need to pick one of the following:

  • Let anyone anywhere (or at least on the network you're on) login.
  • Use a password to restrict who can login.
  • Use certificates to restrict who can login. For ssh directly, this means a public/private key pair, either the ssh-style rsa pair or x509 (like for other ssl stuff).
  • This is a little confused: 1) su is not sudo 2) with sudo the "as root" does not apply. While using su is an option, I (as a former Unix sysadmin) would rather see a focus on the use of sudo. Jan 31, 2012 at 11:07
  • 1
    I don't see what you mean. 1) sudo does not look like logging in as or switching to a user, su does. The op wanted to log in as some user, not execute commands as it. 2) sudo lets you execute commands as another user (see man sudo if you don't believe me). In this case you would like to execute su as root to avoid having to give a password for the user you switch into. 3) Different tools for different tasks, although I guess some people have higher tolerances than me for typing sudo -u postfix before their actual commands.
    – Eroen
    Jan 31, 2012 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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