折腾:
【已解决】rsync同步时使用–password-file但是没用仍需要输入密码
期间,需要去mac中安装sshpass。
搜:
mac 安装 sshpass
去
➜ http_restful_api git:(master) ✗ brew install sshpass
Error: 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.
强制安装,也出错:
➜ http_restful_api git:(master) ✗ brew install http://git.io/sshpass.rb
curl: (7) Failed to connect to git.io port 80: Connection refused
Error: Failure while executing: /usr/bin/curl –show-error –user-agent Homebrew/1.3.4\ (Macintosh;\ Intel\ Mac\ OS\ X\ 10.13.2)\ curl/7.54.0 –fail –progress-bar –location –remote-time –continue-at – –output /Users/crifan/Library/Caches/Homebrew/Formula/sshpass.rb http://git.io/sshpass.rb
再试试:
➜ http_restful_api git:(master) ✗ brew install https://raw.github.com/eugeneoden/homebrew/eca9de1/Library/Formula/sshpass.rb
######################################################################## 100.0%
Error: Calling Formula.md5 is disabled!
Use Formula.sha256 instead.
/Users/crifan/Library/Caches/Homebrew/Formula/sshpass.rb:6:in `<class:Sshpass>’
Mac下,使用sshpass让iTerm2支持ssh登录信息保存 – 简书
最后终于安装成功了:
➜ http_restful_api git:(master) ✗ brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb
######################################################################## 100.0%
==> Downloading http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz
==> Downloading from https://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz
######################################################################## 100.0%
==> ./configure –prefix=/usr/local/Cellar/sshpass/1.06
==> make install
🍺 /usr/local/Cellar/sshpass/1.06: 9 files, 41.6KB, built in 28 seconds
【总结】
mac中没发直接(用brew)安装sshpass。
最后参考Installing SSHPass去用:
brew install https://raw.githubusercontent.com/kadwanev/bigboybrew/master/Library/Formula/sshpass.rb
是可以自动安装的。
安装后,去看看版本信息,支持哪些参数:
➜ http_restful_api git:(master) ✗ sshpass -V
sshpass 1.06
(C) 2006-2011 Lingnu Open Source Consulting Ltd.
(C) 2015-2016 Shachar Shemesh
This program is free software, and can be distributed under the terms of the GPL
See the COPYING file for more information.
Using “assword” as the default password prompt indicator.
➜ http_restful_api git:(master) ✗ 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
-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
➜ http_restful_api git:(master) ✗ which sshpass
/usr/local/bin/sshpass
供后续使用。
此处后续打算使用-f filename。
转载请注明:在路上 » 【已解决】Mac中安装sshpass