my problem is relatively simple to explain. I created a sshtunnel.sh script to establish not one but three ssh tunnel in order to obtain remote access to my Raspberry (between every ssh tunnel command there is a sleep 5). Script is set as executable and I have created the symbolic link to this script in /usr/local/bin/sshtunnel.sh. From the bash shell everything is fine: launching the script works either by ./sshtunneling.sh or by simply sshtunnel from everywhere. Using crontab -e I've set @reboot sshtunnel, but it doesn't work. So I looked in /etc/rc2.d/ and I've noticed cron were started before ssh, so I changed it: sudo mv /etc/rc2.d/S03cron /etc/S04cron (ssh is S03ssh). It still doesn't work. On a side note, before setting up all of these, there were already another instruction in crontab -e: @reboot pushover "Boot ok". It simply called a Python script that would have sent a Pushover.net notification to let me know the boot was just fine (my Raspberry is a headless server). This instruction worked just fine until the sshtunnel thing. Where am I doing something wrong? Thanks in advance3

1 Answer 1


Have you tried adding the absolute path to the script in the crontab entry? Cron doesn't load any environment by default and it may not be finding the script to execute.

Have you checked for any errors in the script in /var/log/syslog?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.