Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

_dynamic_ssh_creator() {

    for i in `ls ~/.ssh/keys|grep -v ".pub"|grep -v "id_dsa$"`; do

        cmd="$i"ssh

        func="function $cmd {"

        func="$func ssh -i ~/.ssh/keys/$i \$*;"

        func="$func }"

        eval $func

    done
}

_dynamic_ssh_creator

I have so many SSH keys that I can't be arsed to maintain an SSH config - especially when my brain is faster at it. This allows me to type <keyname>ssh and just live my life.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: