linux add public key to server

If ssh-copy-id hangs, you can use this:


cat ~/.ssh/*.pub | ssh root@172.17.0.1 '[[ ! -d .ssh ]] && mkdir .ssh && chmod 700 .ssh || cat >> .ssh/authorized_keys && echo "Key copied"

Leave a Reply

Your email address will not be published. Required fields are marked *