bingoogolapple.github.io
bingoogolapple.github.io copied to clipboard
shell 脚本实现 ssh 自动登录服务器
#!/usr/bin/expect -f
# 设定超时时间为 3 秒
set timeout 3
# fork 一个子进程执行 ssh 命令
spawn ssh root@localhost
# 期待匹配到输入密码提示
expect "*pass*"
# 向命令行输入密码并回车
send "youpwd\r"
expect "]*"
send "cd /opt\r"
send "ls\r"
# 允许用户与命令行交互
interact
大佬,尼怎么把Issues做成自己的博客的啊?
@rgdzh1 https://github.com/bingoogolapple/BGAIssueBlog 按照这个仓库的 README 操作
@bingoogolapple thanks!
good
厉害啊