2

I have followed countless tutorials about how to do this, some of them were the same, some of them were different, didn't matter, because none of them worked in my case, so I'm kind of desperate already.
What I've done (and works for everyone in each tutorial, except for me):

  1. Generated a key using PUTTY Key Generator on my workstation.
  2. Saved private key on my workstation.
  3. Created a folder .ssh in my home directory and gave chmod 700 permissions to it on the server.
  4. Created a file authorized_keys inside the .ssh folder and gave chmod 600 permissions to it on the server.
  5. Inside the authorized_keys file, I copied in the key that the PUTTY key generator had in a single line for OpenSSH on the server.
  6. Uncommented the line AuthorizedKeysFile in the file /etc/ssh/sshd_config so it would point to my file containing the key on the server.
  7. Tried to connect to the server using PUTTY and the previously saved private key file. but I get a server refused our key everytime, no matter what I do.

For the record, I'm trying to connect to the server using a tunnel/channel etc. that Ngrok created for exposing my server to the internet.

What am I doing wrong?

  • You did not mention in your list which step you undertook on your workstation and which on your server. Please edit the question and put that stuff in there as well for each step. – Phillip -Zyan K Lee- Stockmann Oct 15 '16 at 13:51
  • @Phillip-ZyanKLee-Stockmann Edited – Istvan Oct 15 '16 at 13:54
  • On my systems the AuthorizedKeysFile parameter within the sshd_config is commented out and therefore defaults to %h/.ssh/authorized_keys. Where %h is replaced with the home dir of each user that tries to log in. Step 6 should therefore not be necessary - if done wrong, this might present a problem in itself. – Phillip -Zyan K Lee- Stockmann Oct 15 '16 at 14:48
  • SSHD does write info about why it rejected a login to syslog (usually). – Phillip -Zyan K Lee- Stockmann Oct 15 '16 at 14:51

Your Answer

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

Browse other questions tagged or ask your own question.