By Engine23

Moving Mac public key to Linux ( CentOS )

Step 1: Find your Mac public key change into your ssh directory in terminal

cd ~/.ssh/

View your public key

cat id_rsa.pub 

Log into your CentOS via ssh and change into your ssh directory

cd ~/.ssh/

Create a id_rsa.pub

vim id_rsa.pub

You can truncate the entire known_hosts file, or just remove the same IP/URL that your trying to connect to, for us, to keep it simple we are just going to truncate the entire file

> known_hosts

On your Mac copy the id_rsa file contents to be pasted in the next step

cat ~/.ssh/id_rsa

create or update the CentOS id_rsa file, for this example we are creating it and paste the value from the Mac

vim id_rsa

Change the permission level of this new id_rsa file to 600, or you will get warnings

chmod 600 id_rsa

Now when you try to do the connection to the remote host, you should be ready to roll

On your CentOS go ahead and try to do the remote action, in this example is a clone of a GIT repository

git clone git@ /var/www/html/clone/