SOLVED Can't SSH in using RSA keys (permissions/keys are correct as far as I know)

Status
Not open for further replies.

keboose

Explorer
Joined
Mar 5, 2016
Messages
92
I am trying to set up key pair authentication for SSH login. I have disabled password login completely for SSH.

I followed this guide for generating the keys, and setting them up in Putty (I'm using Windows 10.)

After encountering errors, I searched around and checked these things:
  • File/Folder permissions. my user's .ssh folder permissions are 700 (drwx --- ---), and the authorized_keys file permissions are also 700 (-rwx --- ---)
  • checked that the public key I copied from PuttyGen is all on one line in the authorized_keys file (and matched the format of "ssh-rsa [key] [comment, in this case 'rsa-key-20180319']"
  • made sure to restart the SSH service after every change I made
Assuming I generated the key and copied it correctly, key authentication should work (according to other posts in this forum,) but still when I open my Putty profile, I only get two lines in the terminal:
Using username "[my username]".
Server refused our key


In the server GUI, I see this line in the log:
error: Received disconnect from 192.168.1.36 port 59863:14: No supported authentication methods available [preauth]

I made a test user ('sshtest') and used the same public key. IT WORKED! I don't know why, though. One thing I see different about the setups is that my real user's folder is missing a bunch of generated files that are present in the test folder (.cshrc, .login, .mail_aliases, .profile, .shrc, .history, .login_conf, .mailrc, .rhosts). Should I have those in my real user's folder? If so, how can I re-generate them? Is there anything else I should try?
 

keboose

Explorer
Joined
Mar 5, 2016
Messages
92
I figured it out, somehow.

In my user's properties window in the GUI, my permissions ("Home Directory Mode") were set to: [Owner: rwx], [Group: rwx], [Other: r-x]

I set the Group permissions to [r-x], and suddenly I could log in! I don't remember why I changed that in the first place (the sshtest user defaulted to rwx/r-x/r-x). I also removed permissions entirely from the 'other' category, and that did not effect my ability to log in at all.

Should i still try to re-generate those missing files? They don't seem to be very important.
 
Status
Not open for further replies.
Top