-
-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Labels
Description
Description
I've configured crontab as per documentation, but when I'm trying to connect to any SSH inside my cron job it fails on access denied (public key) error.
Steps to reproduce:
touch ./docksal/services/cli/crontab- Add following to recently created file:
* * * * * bash -lc 'env >> /tmp/cron-test.log 2>&1' fin reset cli
Result: once cron will run it will write current environment variables to /tmp/cron-test.log file and there is no SSH_AUTH_SOCK which indicates what ssh keys (what socket) should be used.
Expected behavior: SSH_AUTH_SOCK should be available in crontab job.
Temporary solution:
For me just adding SSH_AUTH_SOCK environment variable at the very beginning of crontab file helped. So following works good and i'm getting no ssh errors with this trick.
.docksal/services/cli/crontab content:
SSH_AUTH_SOCK=/.ssh-agent/proxy-socket
* * * * * bash -lc 'env >> /tmp/cron-test.log 2>&1'
I believe it should be either documented here or automated.
Thanks!
Marlon-Mueller and danlooo