Server Fault is a question and answer site for system and network administrators. 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

I have set up a keybased SSH login on my server. Now when I am not in the office and don't have my key with me, there is no option for me to access my server. Going back to password-based logins is not an option for me.

What is the best practice in this case so that I can use SSH without my key occasionally?

share|improve this question
What do you mean when you say going back to password-based logins is not an option? Are you saying that you are rejecting that as a possibility or that it isn't working for you? So for example would you consider a one-time-password setup? – Zoredache Dec 27 '10 at 22:43
I got a lot of brute force SSH attacks on this server, so I switched to keybased logins. Do one-time passwords work together with keybased logins? If so, this would be an option. – j0nes Dec 27 '10 at 22:49
up vote 1 down vote accepted

Best practice would be to continue only allowing key based logins, and just put up with being locked out when you are without your key.

I am sure there is some way of reconfiguring your sshd config to allow password logins, but how are you going to secure that? Your security is only as good as its weakest link.

There isn't really a "best practice" option between allowing password logins and private key authentication. You have to choose whichever one is most acceptable for you, and just take the problems that come with either on the chin...

share|improve this answer

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.