sshpass ssh 跳过提示输密码

发布于 2015-11-04 / Linux / 0条评论 / 3,122浏览

sshpass 使用 yum 安装

# yum install sshpass 

使用apt-get 安装

# apt-get insatll sshpass

就好了…

但是在mac里面使用brew

$ brew install sshpass
$ No available formula with the name "sshpass" 
We won't add sshpass because it makes it too easy for novice SSH users to
ruin SSH's security.

然后google找到了

$ brew install http://git.io/sshpass.rb

然后搞定

sshpass 使用
顾名思义…

MacBook-Pro:~ denghb$ sshpass -h
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

简单实践

sshpass -p "you password" ssh root@192.168.1.123 

这样就远程连接了,都不会提示输密码
其他需要输入密码远程连接的应该都支持

ps:
不要使用这个东西来暴力破解我的云服务器啊。。。

评论
站长统计