linux客户端保持linux服务端的ssh不断开及linuxmint的alias

最近开始使用linuxmint,服务器在aliyun,没有在服务端特别设置超时时间,默认1分钟在linuxmint的console中没有动静,就会断开连接。比较烦。linux

在网上找到以下两种方式能够在linuxmint的terminal保持对服务端的ssh不断开服务器

一、更改ssh默认配置 默认是在/etc/ssh/ssh_config下,注意不是sshd_config[服务端的ssh配置文件] 增长:ssh

Host *
   ServerAliveInterval 30

二、增长ssh连接时的参数 -o ServerAliveInterval=30code

好比:ssh root@192.168.2.218 -o ServerAliveInterval=30server

附:linuxmint alias使用经过terminal

在~目录下新建.profile文件,get

经过添加以下内容:console

alias dev-server="ssh root@192.168.2.218"配置

而后source ~/.profile 生效,以后便可执行dev-server命令运行对应的命令,免去输入一长串命令的烦恼。file

相关文章
相关标签/搜索