import repository from arizona
[raven.git] / demo / gec11 / scripts / copykeys.sh
1 #!/bin/bash
2
3 KEYDIR=/usr/local/geni/account_setup/keys
4
5 for i in {1..31}; do
6     mkdir /home/guest$i/.ssh
7     cp $KEYDIR/guest$i /home/guest$i/.ssh/id_rsa
8     cp $KEYDIR/guest$i.pub /home/guest$i/.ssh/id_rsa.pub
9     cp $KEYDIR/guest$i.pub /home/guest$i/.ssh/authorized_keys
10     chown -R guest$i /home/guest$i/.ssh
11     chmod 0600 /home/guest$i/.ssh/id_rsa
12     chmod 0640 /home/guest$i/.ssh/id_rsa.pub
13     chmod 0600 /home/guest$i/.ssh/authorized_keys
14 done