我正在使用“rocket-science”bash脚本来快速地将Wordpress代码部署到本地机器上的共享主机上。 一切都在工作,直到昨天。 现在我只是参与了与托pipepipe理员的讨论,试图build议我的一切都好。
这是脚本:
#!/bin/bash printf "Running gulp\n" gulp --production printf "Running rsync\n" rsync -vzrP --update ~/Code/Project/wp-content/themes/foo-theme [email protected]:/home/mylogin/domains/example.com/public_html/wp-content/themes/ --delete
为了不提示密码,我将密钥添加到服务器的.ssh目录中的known_hosts 。 几个月来,这个工作完全没有问题。 昨天我收到消息说“身份certificate已经改变了…”
Running rsync @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by the remote host is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Please contact your system administrator. Add correct host key in /Users/slick/.ssh/known_hosts to get rid of this message. Offending RSA key in /Users/slick/.ssh/known_hosts:7 RSA host key for shared-hosting-server.com has changed and you have requested strict checking. Host key verification failed. rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]
我通过删除build议的行号解决了这个问题。 7从/Users/slick/.ssh/known_hosts并接受新的密钥。
但是这并没有解决rsync问题。
我总是得到:
bash: rsync: command not found rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: remote command not found (code 127) at io.c(226) [Receiver=3.1.2]
请回答我的问题或确认我的理解方式是正确的。
1)我是对的,这个问题是由主机方面造成的,在我的最后一切都可以吗?
2)我的权利,rsync必须存在两端(我的本地Mac)和共享主机以及? 根据这个post – rsync需要在两端。
3)我可以login到远程服务器上没有问题ssh -l mylogin shared-hosting-server.com – 它不要求密码,所以我的ssh -l mylogin shared-hosting-server.com东西安装正确。 在远程服务器上,我input:
rsync
得到
-bash:找不到rsync:命令
和
which rsync
得到
(/ usr / local / bin:/ bin:/ usr / bin:/ usr / local / sbin:/ usr / sbin:/ home / mylogin / bin)
这意味着rsync在主机上不再存在或停止对我可用。 这是问题的根源吗?
感谢您的任何解释。
rsync命令需要安装在传输的两端。
您需要确保它已安装在您的托pipe服务器上。 就这些。