I have a script that checks my home rpi2 for a file using ssh, pk auth, if the file exists it deletes it (again ssh pk auth) and opens a reverse ssh with:
ssh -fN -R xxxx:localhost:22 email@example.com
when running the script from the command line it works well i get the reverse shell.
When running from systemd-cron, i don't get the process up!
ps -efwww|grep "ssh -f"|grep -v grep
the crontab is simply:
*/1 * * * * /home/me/my_r_ssh_script.sh
I verified that:
- happens on both arch arm and arch x86 with systemd-cron installed.
- does not happen on ubuntu with crontab installed.
BTW, i have verified that the script runs as use 'me' and indeed it does do i'm sure it uses the right key, also i tried logging g with -vvv and what i saw was that unlike from command line seems like the remote does not answer when i run from cron OR maybe the answer doesn't get to the client for some reason, not sure why.
Any help\hint is appreciated!