SSH – No password

Get your SSH public key – with from IP prepended – ready to add to the authorized_keys fileĀ of a server you want to log into without a password.

IP=$(curl -Sfs https://wtfismyip.com/text) && KEY=$(cat ~/.ssh/id_rsa.pub) && echo 'from="'$IP'"' $KEY

Go one step further and add it to the server automatically:

IP=$(curl -Sfs https://wtfismyip.com/text) && KEY=$(cat ~/.ssh/id_rsa.pub) && echo 'from="'$IP'"' $KEY | ssh user@host 'cat >> ~/.ssh/authorized_keys'