
@reboot
cron 에서 다음 스크립트를 실행하고 있습니다 root
.
autossh -f -i /home/pi/.ssh/myRemote.pem -R 2210:localhost:22 [email protected]
수동으로 실행하면 제대로 작동하지만 cron
로그에 계속 실패하는 것으로 표시됩니다.
Nov 25 01:15:56 kirkins autossh[1936]: starting ssh (count 1)
Nov 25 01:15:56 kirkins autossh[1936]: ssh child pid is 1947
Nov 25 01:16:01 kirkins autossh[1936]: ssh exited prematurely with status 130; autossh exiting
Nov 25 01:16:40 kirkins autossh[605]: starting ssh (count 13)
Nov 25 01:16:40 kirkins autossh[605]: ssh child pid is 1949
Nov 25 01:16:40 kirkins autossh[605]: ssh exited with error status 255; restarting ssh
Nov 25 01:18:48 kirkins autossh[605]: starting ssh (count 14)
Nov 25 01:18:48 kirkins autossh[605]: ssh child pid is 1970
Nov 25 01:18:49 kirkins autossh[605]: ssh exited with error status 255; restarting ssh
무슨 일이 일어나는지 아는 사람 있나요? 다른 StackExchange 사이트에서 일부 관련 게시물을 보았지만 어떤 솔루션도 나에게 도움이 되지 않았습니다.
답변1
그 이유는 아마도 제어 터미널( 어린이에게는 터미널이 없음) ssh
없이 시작된다는 사실이 마음에 들지 않기 때문일 것입니다.cron
시도해 볼 수도 있습니다 ssh -tt
. 또는 screen
/ 내에서 실행하십시오 tmux
.