Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # i have a raspberry pi. i want run ssh tunnel when system is starting
- # i created script /usr/local/sbin/create_tunnel.sh
- #!/bin/sh
- /usr/bin/ssh -f -i /home/pi/.ssh/key.pem user@host -N -R 51151:localhost:5222
- if [[ $? -eq 0 ]]; then
- echo "Tunnel to host created successfully"
- else
- echo "An error occurred creating a tunnel to host. RC was $?"
- fi
- # changed "chmod +x" and added task to crontab
- # crontab -e
- @reboot /usr/local/sbin/create_tunnel.sh > /usr/local/sbin/tunnel.log
- # after reboot i see in log: An error occurred creating a tunnel to host. RC was 127
- # why?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement