ssh config设置

基本配置

用户配置文件在~/.ssh/config,没有的话新建一个。基本的写法是

Host 名称(自己决定,方便输入记忆的)
    HostName 主机名
    User 登录的用户名

demo

Host mysql-inner
    HostName 172.16.8.152
    Port 29172
    User root
    IdentityFile ~/.ssh/work_id_rsa

防止超时连接

Host *
    TCPKeepAlive yes
    ServerAliveInterval 30
    ServerAliveCountMax 120
发布了20 篇原创文章 · 获赞 1 · 访问量 3960

猜你喜欢

转载自blog.csdn.net/haxyek/article/details/100917325