sshpass簡介及安裝
sshpass簡介:
ssh登陸不能在命令行中指定密碼,sshpass 的出現,解決了這一問題。它允許你用 -p 參數指定明文密碼,然後直接登錄遠程服務器,它支持密碼從命令行、文件、環境變量中讀取。
sshpass安裝:
源碼下載地址:http://sourceforge.net/projects/sshpass/
tar -zxvf sshpass-1.05.tar.gz
cd sshpass-1.05
./configure
make && make install
安裝完成後輸入sshpass出現如下提示即安裝成功:
[root@test ~]# 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
-h Show help (this screen)
-V Print version information
At most one of -f, -d, -p or -e should be used
[root@test ~]#