SSHfix.sh – the small tool I use to enable SSH public/private key login

Post Syndicated from Delian Delchev original http://deliantech.blogspot.com/2017/11/sshfixsh-small-tool-i-use-to-enable-ssh.html

I am just dropping that here. This is sshfix.sh – a small tool I use to enable SSH login to a host.

I use it the same way I use :

./sshfix.sh [email protected]

:

#!/bin/sh
[ -f ~/.ssh/id_.pub ] || ssh-keygen -t -b 2048; ssh $* “(mkdir -p ~/.ssh; echo \”$(cat ~/.ssh/id_.pub)\” >> ~/.ssh/authorized_)”