Can't SSH or Lish into my server - Permission denied (publickey)

I have copied my keys into my account and double-checked they were there, but get the response: Permission denied (publickey). I tried to login via Lish, but it says my login is incorrect. According to the documentation, I should be logging in with my account credentials, but it's not working. I have looked through the forums without any luck.

Thanks for any ideas!

2 Replies

Here are a few quick suggestions for resolving the public key denied error message you are getting via SSH:

First, did you restart sshd after /etc/ssh/sshd_config?

Second, check your /etc/ssh/sshd_config by running the following on your server:

#Check SSH configurations
egrep -i '(password|permit|port|rsa)' /etc/ssh/sshd_config

#Check recent login attempts for additional information about why the login failed
tail -n 30 /var/log/auth.log

Third, if you are still having trouble, I'd triple check your public/private key by working through the steps in our How To Secure Your Server Guide

In regards to LISH: If you are using LISH via Browser, you'll want to login with your "root" credentials that you would have configured when creating the Linode. If you are using LISH via SSH, you'll need to use your Linode Manager credentials.

OK. I must have read some instructions wrong about logging into LISH, but now I'm finally in. I have restarted sshd with no luck.

Unfortunately, running those commands didn't do much since I'm not sure that anything is amiss because I never changed anything to begin with.

My sshd_config:


# What ports, IPs and protocols we listen for
Port 22
HostKey /etc/ssh/ssh_host_rsa_key
PermitRootLogin yes
RSAAuthentication yes
RhostsRSAAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# Change to no to disable tunnelled clear text passwords
# PasswordAuthentication.  Depending on your PAM configuration,
# the setting of "PermitRootLogin without-password".
# PAM authentication, then enable this but set PasswordAuthentication
PasswordAuthentication no

I'm just really frustrated that I can't figure this out. I even overwrote my rsa keys and added them again, then I restarted sshd, but no luck.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct