In order to login to your Linux Server over SSH from a Mac you must first copy over your Public key and Mac OSX does not come with the ssh-copy-id command so you need to copy the public key from Mac OSX to the Linux server manually.
Copy SSH Public Key to Linux from Mac OSX
This assumes you have access to the remote server via password based authentication (typing in a password), to start with lets copy the key over.
1
|
|
(Your key name may differ) If the .ssh directory does not exist on the remote server you will need to login and create it.
Now the key has been copied from the mac to the REMOTE Linux server.
Set correct permissions for the SSH Public Key on the remote server:
1
|
|
Next add the key to the SSH authorized_keys file, if the file does not exist create it.
If the file authorized_keys already exists in ~/.ssh the use the following command:
1
|
|
If the file does not exist enter the following commands:
1 2 3 4 |
|
You should now be able to login to the Linux server using SSH key based authentication from your Mac.