(Most threads about this issue are either AWS or GitHub related. Mine is neither. It's a simple Digital Ocean CentOS 8 server.)
My old Macbook connects to my SSH server without any issues:, using
ssh -2 -p 5555 -i /Users/Me/.ssh/id_rsa me@99.99.99.99
(Port number and IP changed for privacy, of course.)
I bought a new Macbook Pro, and have set up the ssh-keygen
stuff as usual, then manually moved the id_rsa.pub
to the server's .ssh/authorized_keys
. On the server, I did this adding to the authorized keys file using nano while logged in as the root user. So this below is what the .ssh
dir looks like on the server, when logged in as the root user:
990971649 -rw-------. 1 root root 2722 Jul 7 07:52 authorized_keys
990971651 -rw-------. 1 root root 3389 Jan 10 2021 id_rsa
990971652 -rw-------. 1 root root 747 Jan 10 2021 id_rsa.pub
But despite adding the id_rsa.pub stuff into the authorized_keys on the server, I get this error:
me@99.99.99.99: Permission denied (publickey)
Most threads on this issue have been 'solved' by adding some parameter, but my ssh_config
settings on the server seem to be fine...and this works from my old Macbook! Below are the server settings--
Protocol 2
Port 5555
LoginGraceTime 60
ClientAliveInterval 120
ClientAliveCountMax 3
MaxSessions 6
AllowUsers root
PermitEmptyPasswords no
PasswordAuthentication no
PermitRootLogin yes
X11Forwarding no
MaxAuthTries 6
IgnoreRhosts yes
AllowTcpForwarding no
AllowAgentForwarding no
Compression no
TCPKeepAlive no
UseDNS no
HostbasedAuthentication no
PubkeyAuthentication yes
AuthenticationMethods publickey
What else could be going wrong?