Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Mar 13, 2015 12:07 am 
Offline
Newbie

Joined: Wed Feb 15, 2012 4:05 am
Posts: 3
AOL: 88
Location: Australia
I have a new Centos 7 Linode and have been following this guide to secure:
https://www.linode.com/docs/security/se ... our-server

Adding a New User
Works fine

Using SSH Key Pair Authentication

In a terminal on my Mac, changing example_user, IP address as appropriate:
ssh-keygen
scp ~/.ssh/id_rsa.pub example_user@123.456.78.90:

In a terminal to my server
mkdir .ssh
mv id_rsa.pub .ssh/authorized_keys
chown -R example_user:example_user .ssh
chmod 700 .ssh
chmod 600 .ssh/authorized_keys

The guide says:
"The SSH keys have been generated, and the public key has been installed on your Linode. You’re ready to use SSH key pair authentication! To try it, log out of your terminal session and then log back in. The new session will be authenticated with the SSH keys and you won’t have to enter your account password."

I cannot get past this stage. Any new session is not authenticated with the SSH keys. Any guidance what I am doing wrong?

Thanks


Top
   
PostPosted: Fri Mar 13, 2015 1:27 am 
Offline
Senior Newbie

Joined: Fri Oct 19, 2012 8:35 pm
Posts: 15
I'm fairly sure the authorized_keys should be 644 (publicly readable, user only write)
otherwise, the ssh process cannot load your public key for authentication

Edit: I take that back... man pages recommend 600 (so the problem is elsewhere)
try checking the output of
Code:
$ ssh -vv example_user@server_ip


Last edited by ken-ji on Fri Mar 13, 2015 1:35 am, edited 1 time in total.

Top
   
PostPosted: Fri Mar 13, 2015 1:32 am 
Offline
Newbie

Joined: Wed Feb 15, 2012 4:05 am
Posts: 3
AOL: 88
Location: Australia
Cheers. I found the issue to be naming the file something other than id_rsa which need to do if have multiple SSH keys. Need to have a config file in the ~/.ssh folder to specify which key to use for which server.


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