How do I revert back to SSH key authentication?

Recently, I installed fail2ban to secure my server. I made a mistake in configuration, and when I entered my pass phrase for my key, I made in error. The fail2ban package jailed me. I purged the package from my system, but I still can't revert to my pass phrase authentication. Further, when I try to create a new .ssh directory and file for .ssh/authorized_keys, it gives me the message: "Cannot touch home/my_username/.ssh/authorized_keys. Permission denied." I followed the instructions specified in the how to secure your server guide. Also, when I try to remove it, it says: "no such file or directory. Is their a way I can revert back to logging in with my pass phrase. Have I broken my SSH access beyond repair?

4 Replies

Linode Staff

Hi @alonza1221 - If you ever need to log into your Linode but aren't able to reach it normally try logging in via Lish:

https://www.linode.com/docs/networking/using-the-linode-shell-lish/

It provides access in a way that doesn't use SSH or regular network connections so things like fail2ban won't affect it. From there you can then log in with the 'root' username and password to make changes to your SSH configuration and fail2ban as needed.

@alonza1221 --

fail2ban(1) has a client program…fail2ban-client(1) that would allow you to un-jail your IP address like this:

sudo /usr/bin/fail2ban-client set <JAIL> unbanip <IP>

Substitute for <JAIL> and <IP> appropriately for your situation.

You can get more information with man fail2ban-client or see here:

https://www.fail2ban.org/wiki/index.php/Commands

-- sw

This client is not a package that can be found. I'm doing this with the command. I am ssh-ed into my linode with my local computer, but it cannot find the client you specified

@alonza1221 --

fail2ban-client(1) is part of fail2ban. You wrote originally:

I purged the package from my system, but I still can't revert to my pass phrase authentication.

You need to reinstall fail2ban.

-- sw

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