Skip to content

SSH Public Key

If for any reason you need to provide me with remote access to a Linux server, you may import my public SSH key by appending it to ~/.ssh/authorized_keys for a standard user or /root/.ssh/authorized_keys for root level functions This will allow for passwordless authentication while the key is present in your authorized_keys file.

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDIGgHdLtavoFZzN6UohqZh/fBS4CAgMBiuccF/0eBRWPu6Dx3Xir+lyTkuiOIIepkG2ncFp9kEObWUc+5XA7bfi6ENxDLdP7qCGL2rmyMeg9f9cK6Z4BVCAKRjaRs9SXL74BZLncr4Mpe8WCi3sVnsxzzsuJyK5WjdiBMOXfd0B5oGWdJmI3E5yqPFD1NEzoD61f09g+wpa3tekXdgwayHeaZDuGkUXC8cvlkh8AO4u1OQpRd+k67NMBavxynhP2YhJVFAyUumwxjokg+H15ji6IsC6E/pOhs79PrUc7McF7jwTMOzkCvSu0ltASVefcoP/NANGX1Nry8dTFn83g9b6FFXN81hqp+eRsFq48/KgERX9S8h2X1sqdri+taCKy2mI36vNEwODQtXwrC7IHBaKffmQUwvAx+OOalNqdAxGn9wWePIJm5N8ivIxIVPBm5QGykldQnpYqqLiLqY6qVeJW4CQjCwO1Csx9RrpuLdx3qt3HTizmZBNy/qYRPnkOM= kmyers@KMyers-Nexus

Script to add my Public SSH Key to the Current User

If you are unsure of the process to setup key based authentication, I have created the following script to add my keys to your authorized_keys. This will only have the permissions of the user that it is ran under. If you ever need to grant root access, please run the command under your root account.

mkdir -p ~/.ssh && echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDIGgHdLtavoFZzN6UohqZh/fBS4CAgMBiuccF/0eBRWPu6Dx3Xir+lyTkuiOIIepkG2ncFp9kEObWUc+5XA7bfi6ENxDLdP7qCGL2rmyMeg9f9cK6Z4BVCAKRjaRs9SXL74BZLncr4Mpe8WCi3sVnsxzzsuJyK5WjdiBMOXfd0B5oGWdJmI3E5yqPFD1NEzoD61f09g+wpa3tekXdgwayHeaZDuGkUXC8cvlkh8AO4u1OQpRd+k67NMBavxynhP2YhJVFAyUumwxjokg+H15ji6IsC6E/pOhs79PrUc7McF7jwTMOzkCvSu0ltASVefcoP/NANGX1Nry8dTFn83g9b6FFXN81hqp+eRsFq48/KgERX9S8h2X1sqdri+taCKy2mI36vNEwODQtXwrC7IHBaKffmQUwvAx+OOalNqdAxGn9wWePIJm5N8ivIxIVPBm5QGykldQnpYqqLiLqY6qVeJW4CQjCwO1Csx9RrpuLdx3qt3HTizmZBNy/qYRPnkOM= kmyers@KMyers-Nexus" >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys

Script to remove my Public SSH Key from the Current User

When we are done with my SSH Key, you can use the following command to remove my SSH Key from the current users SSH authorized_keys file. If you added my key under the root user, you will need to run this command under the root user to remove it as well.

awk '!/kmyers@KMyers-Nexus/' ~/.ssh/authorized_keys > ~/.ssh/temp_authorized_keys && mv ~/.ssh/temp_authorized_keys ~/.ssh/authorized_keys