Posted By

cruelfate on 01/07/11


Tagged

Bash ssh passwords Certificate


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

cruelfate
tazjel


auth.sh


 / Published in: Bash
 

SSH certificate distribution - never enter another password

  1. #!/bin/bash
  2. if [ ! -f ~/.ssh/id_dsa.pub ]
  3. then
  4. echo 'id_dsa.pub does not exist, creating'
  5. ssh-keygen -tdsa
  6. fi
  7. ssh $1 '[ ! -e .ssh ] && mkdir .ssh ; [ ! -e .ssh/authorized_keys ] && touch .ssh/authorized_keys ; cat >> .ssh/authorized_keys' < ~/.ssh/id_dsa.pub

Report this snippet  

You need to login to post a comment.