I am trying to connect to a Linode (running Ubuntu 12.04 LTS) from my local machine (also running Ubuntu 12.04 LTS)
I have created a private and public key on my local machine and copied my public key to my Linode's authorized_keys file. However, whenever I try to ssh to my Linode I get the error message Permission denied (publickey)
.
It's not a problem with how ssh is set up on my Linode because I can ssh to it from my Windows machine using key authentication.
In my .ssh
directory on my local Ubuntu machine, I have my id_rsa
and id_rsa.pub
files. Do I need to create an authorized_keys file on my local machine?
EDIT: This is what I get when I run ssh -vvv -i id_rsa [youruser]@[yourLinode]
:
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
/var/log/auth.log
) 2) How did you transfer the public key to the server? Always usessh-copy-id
to be sure about permissions. Your home directory, the.ssh
directory and theauthorized_keys
file have strict permission requirements. (see manpage ofsshd
(8) on~/.ssh/authorized_keys
). 3) Did you generate a new keypair on Ubuntu? In case you reused the key from Windows - you'll have to convert it to OpenSSH format first.ssh -vvv -i .ssh/id_rsa ....
(note the path to id_rsa!) - please replace - the old log only shows that "we" had no pubKey to send.ssh -vvv
will report "no mutual signature algorithm" if this is the case. To fix, either update your ssh server to supportrsa-sha2
, or regen your key withssh-keygen -t ed25519
, or pass-o PubkeyAcceptedKeyTypes=+ssh-rsa
to the ssh client.