2 # Do some of the steps necessary to SSH (key-based) with another server.
5 expect_n_args 1 "(server IP)" "$@"
8 # We need a public key to copy over, so generate it if not found.
9 if [ ! -f ~/.ssh/id_rsa.pub ]; then
13 # Add target to ~/.ssh/known_hosts so we don't get
14 # asked for permission at inopportune moments.
15 ssh-keyscan -H "$target" >> ~/.ssh/known_hosts
17 # Tell user what to do.
18 echo "APPEND FOLLOWING TO TARGET'S ~/.ssh/authorized_keys:"