2017年9月26日 星期二

Install sshpass

Last updated on Sep 26th, 2017 by sammtcbn

[1] Install sshpass on babun

At first, download latest sshpass from sourceforge.
Next, launch babun shell and enter following commands to install it.

# tar zxfv sshpass-1.05.tar.gz
# cd sshpass-1.05
# ./configure
# make
# make install

Then, sshpass.exe will be installed in /usr/local/bin .
Now I can use sshpass+ssh to login my server from my babun shell.

# sshpass -p password ssh user@ip

Example: Login and run command free to check memory usage.
# sshpass -p password ssh -o StrictHostKeyChecking=no user@ip free

Example: Use sshpass+scp to upload file.
# sshpass -p password scp -o StrictHostKeyChecking=no file user@ip:Path

[2] Install sshpass on Ubuntu 16.04.2

$ sudo apt-get update

$ sudo apt-get install sshpass

沒有留言: