Manually install sshpass on Mac

1. Download the installation package

https://sourceforge.net/projects/sshpass/
insert image description here

Unzip and enter the installation package directory

tar -zxvf sshpass-xx.xx.tar.gz
cd sshpass-xx.xx

2. Check the environment, compile the source code and install

./configure

make&&make install

3. Check whether the installation is successful

▶ sshpass
Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
   -f filename   Take password to use from file
   -d number     Use number as file descriptor for getting password
   -p password   Provide password as argument (security unwise)
   -e            Password is passed as env-var "SSHPASS"
   With no parameters - password will be taken from stdin

   -P prompt     Which string should sshpass search for to detect a password prompt
   -v            Be verbose about what you're doing
   -h            Show help (this screen)
   -V            Print version information
At most one of -f, -d, -p or -e should be used

4. use

sshpass -p [密码] ssh [用户名]@[服务器地址] -p [端口]

Guess you like

Origin blog.csdn.net/w_monster/article/details/132722794