I am planning to automate aws-rackspace server migration. I am following the official rackspace documentation(https://github.com/cloudnull/InstanceSync/blob/master/rsrsyncLive.sh) which uses rsync to migrate. I have modified the code to use sshpass to dynamically provide login password while making an SSH connection to the remote server.
sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no username@IPAddress
But I am facing trouble installing sshpass package.
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)
I even tried 'yum update' and then 'yum -y install sshpass' but it didn't work.
Thanks,
I found this answer on another stack overflow page, but it worked for me when yum install sshpass was returning
"No package sshpass available"
when trying to install on an AWS instance.
Command:
yum --enablerepo=epel -y install sshpass
On Amazon Linux 2 I do it like this
sudo amazon-linux-extras install epel -y
sudo yum-config-manager --enable epel
sudo yum install sshpass