【问题标题】:Crontab a git pull from SSH repository with password [duplicate]Crontab 使用密码从 SSH 存储库中提取 git [重复]
【发布时间】:2017-07-28 10:13:08
【问题描述】:

我可以在 crontab 命令管道中传递密码以访问 git 存储库 ssh 服务器吗? 喜欢

*/10  * * * cd /path/gitpath/ && git pull ssh://user:password@XXX.XX.XX.XXX/path/reporitory.git

或者最好用密码来 cron 一个 bash 脚本?

【问题讨论】:

标签: git ssh cron passwords


【解决方案1】:

如果可以的话,我建议设置 ssh 公钥/私钥。这样你在从 repo 中提取时就不需要使用密码了。

https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-07-29
    • 2018-07-27
    • 1970-01-01
    • 2013-03-22
    • 2011-05-28
    • 2014-12-10
    • 1970-01-01
    相关资源
    最近更新 更多