mac-安装sshpass
id_rsa.pub路径:cat ~/.ssh/id_rsa.pub
在配置了ssh免密认证id_rsa.pub之后,在cmd终端可以实现免密登陆对应配置了密钥的服务器,但是在python程序中,想要调用cmd执行免密操作,还需要安装sshpass,sshpass用于非交互式的ssh密码验证
没有sshpass报错:to use the 'ssh' connection type with passwords, you must install the sshpass program
步骤:
1.在官网下载源码包
wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz
2.解压
tar xvzf sshpass-1.05.tar.gz
3.进入解压文件
cd sshpass-1.05
4.检验环境
./configure
5.源码编译安装
make&&make install
python 中文名:蟒蛇,设计者:Guido van Rossum