Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
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 '12 at 17:45
add comment

3 Answers

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).
share|improve this answer
    
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. –  reinierpost Jan 31 '12 at 11:07
    
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 '12 at 13:35
add comment

Allow PermitEmptyPasswords in sshd_config and restart sshd.

share|improve this answer
2  
Why would that help? –  reinierpost Jan 31 '12 at 11:04
add comment

PermitEmptyPasswords yes then restart sshd ?

share|improve this answer
    
This works, but is horribly insecure. –  Piskvor Jan 31 '12 at 12:31
    
For sure, but well, as said : I would not like to use public keys on this setup. –  Lucas Jan 31 '12 at 16:43
    
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 at 6:42
add comment

Your Answer

 
discard

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.