Shell脚本学习(二)制作SSH登录远程服务器的Shell脚本
Ubuntu环境需要安装expect安装包
sudo apt-get install expect
使用shell脚本自动ssh登录远程服务器
login.sh
#!/usr/bin/expect -f
# 设置ssh连接的用户名
set user liuben
# 设置ssh连接的host地址
set host 10.211.55.4
# 设置ssh连接的port端口号
set port 9999
# 设置ssh连接的登录密码
set password admin
# 设置ssh连接的超时时间
1617


制作SSH登录远程服务器的Shell脚本&spm=1001.2101.3001.11974&articleId=52166960&d=1&t=3&u=64b9ee5b562e4b3ebcc13ad7320f9514)

被折叠的 条评论
为什么被折叠?



