SSH access using .pub key
You got it the wrong way round :-)
- create a key pair on the Mac you are using
- put both
id_rsa.pub
andid_rsa
into~/.ssh
and runchmod 600 id_rsa
-
append the generated public key (
id_rsa.pub
) to.ssh/authorized_keys
on the remote machine (your server in this case). If you are allowed to login in viassh
using a password, usessh remoteuser@remotemachine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys" < ~/.ssh/id_rsa.pub
otherwise transfer the file by whatever means you have to upload files.
- run
ssh remoteuser@remotemachine
in your shell to connect
PS: The private key should never need to leave the machine it's generated on