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


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-15
  • 2021-12-09
  • 2022-12-23
  • 2021-09-13
  • 2021-06-19
  • 2022-01-26
猜你喜欢
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案