SSH

Useage

$ ssh <username>@<host-ip>

Keys

Courtesty of stackexchange

Generating a Key Pair the Proper way

ssh-keygen -t rsa
ssh root@remote_servers_ip "mkdir -p .ssh"
cat ~/.ssh/id_rsa.pub | ssh root@remote_servers_ip "cat >> ~/.ssh/authorized_keys"
ssh root@remote_servers_ip "chmod 700 ~/.ssh; chmod 640 ~/.ssh/authorized_keys"
ssh root@remote_servers_ip
uncomment "Protocol 2" in /etc/ssh/sshd_config
uncomment "PubkeyAuthentication yes" in /etc/ssh/sshd_config
restorecon -Rv ~/.ssh

If you get "The program 'restorecon' is currently not installed. You can install it by typing"

sudo apt install policycoreutils

...then run that

Over Two ssh Hops

larkinweb

ssh from systemA trough systemB into systemC:

$ ssh -t user1@systemB "ssh user2@systemC"

Mount file system under similar circumstances: