iTerm2连接Linux服务器

Myth丶恋晨 2023-09-29 22:02 76阅读 0赞

1. 进入.ssh目录

cd ~/.ssh/

#

2. 创建文件,文件名称自定义

vim centos7-info

#

3. 文件中添加以下内容

  1. #!/usr/bin/expect -f
  2. set PORT 端口
  3. set HOST IP地址
  4. set USER 账号
  5. set PASSWORD 密码
  6. set timeout -1
  7. spawn ssh -p $PORT $USER@$HOST
  8. expect {
  9. "*yes/no*" {send "yes\r";exp_continue;}
  10. "*password*" {send "$PASSWORD\r"}
  11. }
  12. interact
  13. expect eof

#

4. 打开 iTerm2 >>> Preferences

4e9d5b305ed047158165ea96cd5786f2.png

#

5. 按照以下配置

7f818f81f5d348679ad31c45174539ad.png

#

6. 打开终端

fc3cbea1c8ac45f6ba07f428eae1d875.png

参考:https://blog.csdn.net/weixin_43274002/article/details/124063972

发表评论

表情:
评论列表 (有 0 条评论,76人围观)

还没有评论,来说两句吧...

相关阅读