shell账号密码登陆
来源:原创
时间:2021-03-03
作者:脚本小站
分类:SHELL
安装命令工具:在epel yum源中。
yum install -y sshpass
shell脚本:
#!/bin/bash sshpass -p 123456 ssh -tt root@192.168.0.13 "date"
执行:
]# bash -x demo.sh + sshpass -p 123456 ssh -tt root@192.168.0.13 date Wed Mar 3 10:16:24 EST 2021 Connection to 192.168.0.13 closed.