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?
Hi @alonza1221 - If you ever need to log into your Linode but aren't able to reach it normally try logging in via 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.
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:
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