I am trying to create a new ssh key, and copy it to a server, using a previously generated ssh key.
/usr/bin/ssh-copy-id -f -i /home/pi/.ssh/newKey -o "IdentityFile=/home/pi/bob" [email protected]
The following command is run using the rc.local (I also tried cron) and it will fail to copy the key to host.edu. But if I run the same command after I login locally to the pi, then it runs fine. How can I get this to run without logging onto the pi?
EDIT:
The rc.local runs the command is the pi user.
su pi -c '/home/pi/setup.sh'
0 Answers