Running ssh in a cronjob
My use case is the following: I want to run scheduled github pulls. Again we can configure a cronjob. But to be able to access github using our public/private key we have to create an extra config file:
- Create a file named "config" in your .ssh folder:
- Edit this config file using your preferred editor.
Hostname github.com IdentityFile <paht-to-your-private-key> IdentitiesOnly yes
Now the cronjob can access github by using the identity file.