Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Sep 03, 2015 2:28 pm 
Offline
Newbie

Joined: Thu Sep 03, 2015 2:11 pm
Posts: 4
I've been following the linode guide on setting up my server, and I'm sadly stuck at the very beginning. I'm running a Windows desktop client, so I had to follow the rather unconventional ways of downloading and installing a few programs to create authorization keys. I copied the public key generated by PuttyGen into my ~/.ssh/authorized_keys and directed putty to the saved file on my computer, but no matter what I do, every time I restart putty and load the session to see if it works, it always says "Server refused our key" when I login under my user name. I also have no idea why the linode guide told me I needed to get WinSCP; I have not used it once.
I'm at my wits end, and about to reinstall the entire server OS again just to see if I messed something up in my 5 hours of attempting to fix this issue.

I am using CentOS 7 64 bit.

ls -l in /home/user/.ssh directory returns this:

total 16
-rw-rw-r-- 1 user user 0 Sep 3 12:57 authorized_key
-rw-r--r-- 1 user user 397 Sep 3 13:48 authorized_keys
-rw------- 1 user user 1675 Sep 3 00:54 id_rsa
-rw-r--r-- 1 user user 392 Sep 3 00:54 id_rsa.pub
-rw-r--r-- 1 user user 175 Sep 3 12:41 known_hosts

authorized_keys contains the public key generated in PuttyGen. Putty has its SSH Auth private key directed at the saved .ppk on my Windows client.

Any help is appreciated.


Last edited by tincancrab on Sat Sep 05, 2015 11:47 pm, edited 1 time in total.

Top
   
PostPosted: Thu Sep 03, 2015 3:18 pm 
Offline
Senior Member

Joined: Wed Oct 20, 2010 12:11 pm
Posts: 142
The /home/<user>/.ssh directory needs to be chmoded to 700 and owned by user:user.

authorized_keys needs to be chmoded to 600 and owned by user:user


Top
   
PostPosted: Thu Sep 03, 2015 9:04 pm 
Offline
Newbie

Joined: Thu Sep 03, 2015 2:11 pm
Posts: 4
Thanks for the help, but it's still not working. My .ssh file permissions was 700, my authorized_keys somehow had gotten changed back, probably during one of the times I tried editing it.

ls -la ~ returns .ssh file as:
drwx------ 2 user user 4096 Sep 3 13:48 .ssh

ls -l ~/.ssh returns authorized_keys as:
-rw------- 1 user user 397 Sep 3 13:48 authorized_keys

Terminal in PuTTy still returns "Server refused our key."


Top
   
PostPosted: Fri Sep 04, 2015 6:47 pm 
Offline
Senior Member

Joined: Wed Oct 20, 2010 12:11 pm
Posts: 142
Check out /var/log/secure or /var/log/auth.log - those might help diagnose.


Top
   
PostPosted: Fri Sep 04, 2015 9:59 pm 
Offline
Newbie

Joined: Thu Sep 03, 2015 2:11 pm
Posts: 4
derfy wrote:
Check out /var/log/secure or /var/log/auth.log - those might help diagnose.


Well. It's hard to find the information needed when there's 64,840 lines in the file. What should I exactly be looking for? Most of the lines just tell me about the failed logins. That brings up another question of why there were over 6k failed attempted logins today alone for root, with my computer asleep and myself at work, and this server is only 3 days old.

316 in the past 45 minutes or so. That's peculiar...


Top
   
PostPosted: Fri Sep 04, 2015 10:24 pm 
Offline
Junior Member
User avatar

Joined: Mon Jul 07, 2014 8:47 pm
Posts: 21
Website: https://arlen.io
Location: Earth
Twitter: arlenwoot
There are 6k failed attempts because its the internet. People scan everything and try to login.

Its been years since I've used putty but if I remember correctly putty uses a different format for public keys.
Make sure the public key you put in authorized_keys begins with 'ssh-rsa AAAA' ends with '==' and is all on one line.


Top
   
PostPosted: Sat Sep 05, 2015 8:35 pm 
Offline
Newbie

Joined: Thu Sep 03, 2015 2:11 pm
Posts: 4
arlen wrote:
There are 6k failed attempts because its the internet. People scan everything and try to login.

Its been years since I've used putty but if I remember correctly putty uses a different format for public keys.
Make sure the public key you put in authorized_keys begins with 'ssh-rsa AAAA' ends with '==' and is all on one line.


THANK YOU. That was the issue. The text they gave me to paste ended with "==rsa-keyxxxxx". Deleting that fixed it! And I figured so, but this is my first time being owner of a server, so it freaked me out a bit.


Top
   
PostPosted: Sat Sep 05, 2015 8:38 pm 
Offline
Junior Member
User avatar

Joined: Mon Jul 07, 2014 8:47 pm
Posts: 21
Website: https://arlen.io
Location: Earth
Twitter: arlenwoot
Awesome! \o/ :D let the fun begin!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group