I keep receiving the following error upon running ssh -v -i privatekey [email protected]
.
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to server.org [XXX.XXX.XXX.XXX] port 22.
debug1: Connection established.
debug1: identity file privatekey type 1
debug1: key_load_public: No such file or directory
debug1: identity file privatekey-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to server.org:22 as 'user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client [email protected] <implicit> none
debug1: kex: client->server [email protected] <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:ig8ZTpASPM0W/drPBHPzcUIr+NtqzOKvVAvihnbaNuc
debug1: Host 'server.org' is known and matches the RSA host key.
debug1: Found key in /Users/XXX/.ssh/known_hosts:3
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: ysm
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /Users/XXX/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
I don't understand what's wrong. I've copied my public key properly and edited permissions on the private key file to ensure it's secure.
-i privatekey
the same as the referenced /Users/XXX/.ssh/id_rsa?debug1: key_load_public: No such file or directory
is not an error. Just a debug message. The key is rejected on the server side and without information from the server log, it is not possible to help you.