SSH Not Allowed Even With All Settings and Key Uploaded

Linode Staff

Hello Linode Community!

I've been confounded by the Linode public key system for several days, now. I've used the inbuilt manager button to access LISH and ensured that the right public key is in authorized_keys file in ~/.ssh/. I've gone into sudo vim /etc/ssh/sshd_config and changed PubKeyAuth to yes. I've generated an appropriate key with ssh-keygen, tried like mad to ssh-add specific keys (can't seem to find the right flag for it), and then ssh-copy-to -k ssh-pubkey-file-name admin@nanode-ip-address. Of course, it says that it skipped the file because I'd already copy/pasted it directly into authorized_keys, but it accepts the attempt (doesn't deny it or time out or something).

I've followed the Set Up and Secure a Compute Instance, How to Use SSH Public Key Authentication, and the SSH Customization Tricks instructionals, as well as several decent-seeming Community help answers, to the letter for my local machine (Windows 10 Pro 22H2) and the compute instance: Ubuntu 24.04 LTS.

UI Manager firewall is not present and Linux internal firewall (UFW) is disabled, so everything is being allowed, at least for now.

I can access LISH from local machine and log into my non-root account, which is a step in the right direction, and I can access root@ip-addy, but I can't access admin@ip-addy (kept root open to use since the secondary admin account can't be accessed). Tried ssh admin@host but keep being told Permission denied (publickey)..

Does anyone have any suggestions?

4 Replies

This can be annoying and I've had my share of issues as with SSH keys too. Generally it comes down to permissions. What user were you logged in as when you created the ~/.ssh directory and who is the owner? You can check this using ls -lah. In your case you want the owner of the directory and everything in it to be the admin user and if it isn't you can change the ownership using the following:

sudo chown -R admin:admin ~/.ssh

Next troubleshooting step is to use verbose mode with your ssh command while logging in to try to get a picture of where the login process may be going wrong. You can use ssh -v or ssh -vvv depending on how much output you need.

Finally, this guide on Troubleshooting SSH on Compute Instances should be helpful.

Thank you! This particular problem turned out to be because Windows doesn't start ssh-agent by default. Once I did that and ssh-add-ed the file, it worked fine. There are some other issues, but it's more of a problem I'm having with ssh in particular, not Linode.

Thank you, again.

Ahh, good TLambert, I see that there was a second post I queried which seems to have been spam-removed. It was regarding the Cloud Manager firewall (not uvw in Linux/LISH). I had posted that, with the firewall in existence, whether it was disabled or assigned to my compute instance or not, it was timing out all incoming SSH requests via my local machine. I had added a rule to accept incoming SSH connections from my IP address and everything.

As a caveat, I'll mention that I'm working from behind the router set up by my landlord. All the tenents have this WIFI connection to share. I do have ufw set up and have given it rules to deny all incoming except SSH attempts from my local machine's IP, it it works just fine. It's just this Manager firewall that blocks.

As a post script, it should be said that, after having deleted the Manager firewall and going back through the setup process, ensuring that uvw firewall worked with its allow rule for my local machine, then recreating and reassigning the Manager firewall, everything still works. Don't know what the deal was there…

Hey, How is everything now?

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