• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
车车大人
博客园    首页    新随笔    联系   管理     

Mac下用iterm操作远程服务器

1.连接 

 ssh -t root@公网ip地址 -p 22(端口号)

2.出现了broken price的现象

这属于丢包现象

解决方案
情景一:如果您有多台服务器,不想在每台服务器上设置,如下操作:

1、运行命令:

cd ~/.ssh/
2、假如运行命令ls,没有config,新建config

vim config
3、在config在里面输入:

ServerAliveInterval 60
4、保存文件(:x)

在链接linux服务器,就不会有断线的问题了。

情景二:如果您有多个人管理服务器,不想在每个客户端进行设置,只需在服务器的 /etc/ssh/sshd_config 中添加如下的配置:

ClientAliveInterval 60
情景三:如果您只想让当前的 ssh 保持连接,可以使用以下的命令:

ssh -o ServerAliveInterval=60 user@sshserver

 

 3.如果服务器被重新恢复那么连接会报错

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:vqZKpmZf6/mQwdhkCbQwv8qIGQ7XRprxtGdEP3AVa9Y.
Please contact your system administrator.
Add correct host key in /Users/hope/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/hope/.ssh/known_hosts:1
ECDSA host key for 39.107.28.55 has changed and you have requested strict checking.
Host key verification failed.

 

解决办法:

ssh-keygen -R 服务器ip地址

 


通往牛逼的路上,在意的只有远方!
posted @ 2018-01-16 17:23  车车大人  阅读(574)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3