ssh 直接使用 TTY 访问,以确保密码是用户键盘输入的。 sshpass 在专门的 tty 中运行 ssh,以误导 ssh 相信它是从用户接收到的密码,下面为大家详细讲解一下Linux下使用sshpass绕过SSH密码验证具体方法。
罗山ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:028-86922220(备注:SSL证书合作)期待与您的合作!
Desktop sudo yum install sshpass
[sudo] password for xuyaowen:
Last metadata expiration check: 0:04:22 ago on Mon 02 Jul 2018 11:25:32 AM CST.
Package sshpass-1.06-5.fc28.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
检查是否安装
[root@yaowenxu Desktop]# rpm -qa sshpass
sshpass-1.06-5.fc28.x86_64
View Code
[root@yaowenxu Desktop]# 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
~ sshpass -p 123 ssh root@10.66.65.15
ssh -o StrictHostKeyChecking=no
来解决
Desktop sshpass -p 123 ssh -o StrictHostKeyChecking=no root@10.66.8.142
Warning: Permanently added '10.66.8.142' (ECDSA) to the list of known hosts.
Last login: Mon Jul 2 10:51:29 2018
优点: 快速,便捷
缺点: 密码明文暴露,可以使用 history 命令查找到
网页标题:Linux下使用sshpass绕过SSH密码验证
网页链接:http://www.shufengxianlan.com/qtweb/news9/115259.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联