installing sshpass on amazon linux AMI based ec2 instance

Pattu picture Pattu · Feb 5, 2014 · Viewed 11.8k times · Source

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,

Answer

Rahul R Dhobi picture Rahul R Dhobi · Feb 5, 2014

You need to manually download source code of sshpass,after that

Extract it and cd into the directory
./configure
sudo make install

Note :: If you do not find make then you can run following command for installing make

sudo yum groupinstall "Development Tools"