tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | #------------------------------------------------------------------------------- |
tom | 1a2908c | 2014-09-23 16:37:39 -0700 | [diff] [blame^] | 3 | # Pushes the local id_rsa.pub to the authorized_keys on a remote ONOS node. |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 4 | #------------------------------------------------------------------------------- |
| 5 | |
| 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | |
| 9 | remote=$ONOS_USER@${1:-$OCI} |
| 10 | |
| 11 | scp -q ~/.ssh/id_rsa.pub $remote:/tmp |
| 12 | ssh $remote "cat /tmp/id_rsa.pub >> ~/.ssh/authorized_keys" |
| 13 | ssh -n -o PasswordAuthentication=no $remote true |