300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > linux sshpass 非交互的ssh密码验证 简介

linux sshpass 非交互的ssh密码验证 简介

时间:2020-07-20 13:32:17

相关推荐

linux sshpass 非交互的ssh密码验证 简介

sshpass 命令的安装:

# yum -y install sshpass

实例1:直接远程连接某台主机:

命令:sshpass -p xxx ssh root@192.168.11.11

实例:本地执行远程机器的命令:

命令:sshpass -p xxx ssh root@192.168.11.11 "ethtool eth0"

实例2:远程连接指定ssh的端口:

命令:sshpass -p 123456 ssh -p 1000 root@192.168.11.11 (当远程主机不是默认的22端口时候)

实例3:从密码文件读取文件内容作为密码去远程连接主机

命令:sshpass -f xxx.txt ssh root@192.168.11.11

实例4:从远程主机上拉取文件到本地

命令:sshpass-p '123456' scproot@host_ip:/home/test/t./tmp/

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。