comparison scripts/setup-ssh.sh @ 99:f03d68f18d7f

Appending key to authorized_keys rather than overwriting the file
author Giulio Moro <giuliomoro@yahoo.it>
date Mon, 27 Jul 2015 11:33:08 +0100
parents 6bfd95cb5744
children
comparison
equal deleted inserted replaced
98:9a413516a1fc 99:f03d68f18d7f
76 printf "Type 'a' (without quotes) when prompted for a password: \n" 76 printf "Type 'a' (without quotes) when prompted for a password: \n"
77 77
78 # StrictHostKeyChecking=no below will prevent the following message upon the first connection: 78 # StrictHostKeyChecking=no below will prevent the following message upon the first connection:
79 # "The authenticity of host '192.168.1.2' can't be established." 79 # "The authenticity of host '192.168.1.2' can't be established."
80 # which would require the user to type 'yes' 80 # which would require the user to type 'yes'
81 cat ${PRIVATE_KEY_FILENAME}.pub | (ssh -q -o StrictHostKeyChecking=no bbb 'mkdir -p .ssh; cat > .ssh/authorized_keys') 81 cat ${PRIVATE_KEY_FILENAME}.pub | (ssh -q -o StrictHostKeyChecking=no bbb 'mkdir -p .ssh; cat >> .ssh/authorized_keys')
82 if [ $? -ne 0 ] ; then 82 if [ $? -ne 0 ] ; then
83 printf "ERROR: An error occurred while copying the public key to the BBB\n" 83 printf "ERROR: An error occurred while copying the public key to the BBB\n"
84 exit 3 84 exit 3
85 fi 85 fi
86 printf "SSH setup complete. You can now ssh into the beaglebone with command: ssh bbb\n" 86 printf "SSH setup complete. You can now ssh into the beaglebone with command: ssh bbb\n"