Why ssh fails from crontab but succedes when executed from a command line?

前端 未结 5 767
隐瞒了意图╮
隐瞒了意图╮ 2021-01-01 09:41

I have a bash script that does ssh to a remote machine and executes a command there, like:

ssh -nxv user@remotehost echo \"hello world\"

Wh

5条回答
  •  無奈伤痛
    2021-01-01 10:08

    Don't expose your SSH keys without passphrase. Use ssh-cron instead, which allows you to schedule tasks using SSH agents.

提交回复
热议问题