我打算自动化aws-rackspace服务器迁移。 我正在使用rsync迁移的官方rackspace文档( https://github.com/cloudnull/InstanceSync/blob/master/rsrsyncLive.sh )。 我修改了代码以使用sshpassdynamic提供login密码,同时build立到远程服务器的SSH连接。
sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no username@IPAddress
但是我在安装sshpass软件包时遇到了麻烦。
Debian based Distros - Installed Successfully CentOS - Installed Successfully Redhat - Package not found (yum list available | grep sshpass) Amazon Linux - Package not found (yum list available | grep sshpass)
我甚至试过'百胜更新',然后'yum -y install sshpass',但它没有工作。
谢谢,
之后,您需要手动下载sshpass的源代码
Extract it and cd into the directory ./configure sudo make install
注::如果您没有找到make,那么您可以运行以下命令来安装make
sudo yum groupinstall "Development Tools"
我认为一点细节可能有助于快速完成此项工作。
这是sshpass可以从哪里下载(搜索任何最新的更新): http : //sourceforge.net/projects/sshpass/files/sshpass/1.05/从页面中获取下载的URL如下
$ wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz/download # on your amazon instance, to download using command line / terminal; this will get you a file named "download" $ mv download sshpass-1.05.tar.gz # note this is the name as in the URL above $ gunzip sshpass-1.05.tar.gz $ tar xvf sshpass-1.05.tar $ cd sshpass-1.05 $ sudo yum groupinstall "Development Tools" # in case configure & make (next 2 commands) does not work, else dont run this command $ sudo ./configure $ sudo make install $ sudo -s # which sshpass #sudo -s and check if sshpass is in the path; on amazon RHEL, for me the root did not have /usr/local/bin in its path; so you may want to set the path appropriately (echo $PATH), or copy sshpass to one of the $PATH directories