0

I know this is a bit weird. I generated ssh keys on my server, but I still want to force clients to enter a passphrase to be able to SSH to the server,even if they have the key. Is that even possible? Can I set a password on top of the key, and force clients to use both to SSH?

  • Are you aware that you can create a key WITH password? – Fiximan Mar 2 '17 at 8:06
  • Yes. But can that passphrase be shared and used (security-wise and feasibility-wise) by clients while ssh-ing? My thought was that this passphrase is for the private key which shoudl not be shared with others! Please correct me if I am wrong. (Sorry I am a complete newbie to the system administration world) – geek2000 Mar 2 '17 at 16:07
  • My bad. I got your needs wrong. Your thinking is correct. – Fiximan Mar 2 '17 at 19:11
1

Without knowing the version of OpenSSH you're running, or the distro, it's difficult to answer. However, there are many ways to achieve this. One such way, if you're running a recent version of OpenSSH, is to use the AuthenticationMethods directive in you /etc/ssh/sshd_config file. Example:

AuthenticationMethods publickey,keyboard-interactive
| improve this answer | |
  • Thank you for your answer. I am running a 6.6.1p1 version. I checked the config file. There is no AuthenticationMethods. Probably because I am running an old version. Do you know by any chance any alternative solution? – geek2000 Mar 2 '17 at 6:33
  • OpenSSH 6.6.1p1 supports AuthenticationMethods option (that it is not in the configuration file does not mean anything). This is correct answer. – Jakuje Mar 2 '17 at 12:49

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.