Thursday, November 30, 2017

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

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

I use it the same way I use ssh:

./sshfix.sh delian@remote-host

The code:

#!/bin/sh
[ -f ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa -b 2048; ssh $* "(mkdir -p ~/.ssh; echo \"$(cat ~/.ssh/id_rsa.pub)\" >> ~/.ssh/authorized_keys)"

2 comments:

  1. Ubiquiti Networks UC-CK Controller Cloud Key in UAE, Unifi Controller Cloud Key in UAE, Controller Cloud Key in UAE
    https://gccgamers.com/ubiquiti-uc-ck.html
    Ubiquiti Cloud Key in UAE, Safe Shopping Multiple Payment Options Express Delivery GCC Gamers Moneyback Guarantee
    1634958729293-10

    ReplyDelete
  2. Ubiquiti Networks UC-CK Controller Cloud Key in UAE, Unifi Controller Cloud Key in UAE, Controller Cloud Key in UAE
    https://gccgamers.com/ubiquiti-uc-ck.html
    Ubiquiti Cloud Key in UAE, Safe Shopping Multiple Payment Options Express Delivery GCC Gamers Moneyback Guarantee
    1634963156195-8

    ReplyDelete