Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

installing sshpass on amazon linux AMI based ec2 instance

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,

like image 909
Pattu Avatar asked Dec 02 '22 17:12

Pattu


2 Answers

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"
like image 80
Rahul R Dhobi Avatar answered Dec 11 '22 10:12

Rahul R Dhobi


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
like image 45
MoVod Avatar answered Dec 11 '22 09:12

MoVod