If you are using RSA keys, then you will want these options set to yes in /etc/ssh/sshd_config on the server.
Originating the reverse SSH connection will require root privileges as you are forwarding a privileged port.
ssh -p <Remote_Connection_Port> -R <Remote_Login_Port>:localhost:22 -i <IDfile> <username_at_server>@<server>
<Remote_Connection_Port> is the port to connect to sshd on the server (default is 22). You need to add a 'Port xxx' to /etc/ssh/sshd_config on the server if you use a port other than 22.
<Remote_Login_Port> is the port that will be used to connect back
<IDfile> is the private key for the user on the originating machine
ssh -p <Remote_Login_Port> <username_at_originating_machine>@localhost
The public key for the originating user
needs to be in ~/.ssh/authorized_keys on the server
The public key for the originating machine
needs to be in ~/.ssh/known_hosts on the server
. (This is found in /etc/ssh/ssh_host_rsa_key.pub on the originating machine
if using RSA protocol.)
The public key for the connecting user
needs to be in ~/.ssh/authorized_keys on the originating
The public key for the connecting machine
needs to be in ~/.ssh/known_hosts on the originating machine
. (This is found in /etc/ssh/ssh_host_rsa_key.pub on the server if using RSA protocol.)
PS - I heavily use my reverse SSH tunnel. Thanks for the refresher! It is years since I set this up.