SSH Key Pair confusion and questions...

General support questions
Post Reply
ethon
Posts: 27
Joined: 2013/07/09 10:14:59

SSH Key Pair confusion and questions...

Post by ethon » 2014/11/14 22:50:58

I am trying to set up a key pair from my office machine to a fresh install of CentOS 7 on several servers.

Do I need a different key/pair for every server? Or do I simply use my public key from my office machine copied to each server?

Where does that public key actually go on the server(s)? There is no /.ssh directory on the new server. I do see a /etc/ssh directory that has (what I assume is) my public and private key for THAT server.

Do I need to create a /.ssh directory in /root then copy my public key there? And how do I name it so that I can have multiple public keys from other machines that also need to access this server?

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: SSH Key Pair confusion and questions...

Post by gerald_clark » 2014/11/14 23:11:29


User avatar
TrevorH
Forum Moderator
Posts: 29069
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SSH Key Pair confusion and questions...

Post by TrevorH » 2014/11/14 23:16:57

Unless you are extraordinarily paranoid, you need only one private/public key pair. You keep the private key yourself and the public one gets uploaded to each server that you want to logon to. The public key is placed in (usually) /home/$USER/.ssh/authorized_keys although this location can be changed from the sshd config file (and almost never is).
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - General Support”