sshpass结合ssh和scp可以自动完成密码登录,无需手动输入密码

  使用方法:

  1、sshpass -p 123456 ssh [email protected] "touch file"  远程创建文件file

  2、sshpass -p 123456 scp file1 [email protected]:~         把本地文件file1传入远程机器1.1.1.2上的用户目录下

猜你喜欢

转载自www.cnblogs.com/shengulong/p/9107998.html
今日推荐