最新消息:时间抓起来说是金子,抓不住就是流水。

centos下设置ssh连接时间

LINUX技术 老子黑牵翻 15907浏览 4评论

基于安全的理由,如果用户连线到 SSH Server 后闲置,SSH Server 会在超过特定时间后自动终止 SSH 连线。以下是设定终止连线时间的方法: 

1、开启 /etc/ssh/sshd_config 档案,里面有一个参数为 ClientAliveCountMax,它是设定用户端的 SSH 连线闲置多长时间后自动终止连线的数值,单位为分钟。 

2、如果这一行最前面有#号,将那个#号删除,并修改想要的时间。 

3、修改后储存及关闭档案,重新启动 sshd: 

/etc/rc.d/init.d/sshd restart 

(必须是绝对路径)

同时基于一些安全考虑有时候我们也会把默认的22端口修改为我们认为比较合适的端口修改的文件也是: /etc/ssh/sshd_config

之后重启 /etc/rc.d/init.d/sshd restart

转载请注明:LINUX服务器运维架构技术分享 » centos下设置ssh连接时间

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (4)

  1. I went over this website and I believe you have a lot of fantastic information, saved to bookmarks (:.
    vera arlen12年前 (2012-03-21)回复
  2. You should take part in a contest for one of the best blogs on the web. I will recommend this site!
    Kendall Mcclement12年前 (2012-03-19)回复
  3. WONDERFUL Post.thanks for share..more wait ..
    Eloisa Rutledge12年前 (2012-03-19)回复
  4. Many thanks for an unbelievable submit, will examine one's others posts. thanks for your ideas for this, I felt a bit struck by this text. Merit again! You earn a great point. Got some wonderful report here. I do think that when more people thought of it like this, they'd have got a better time obtain the suspend ofing the issue.
    peacock feather earrings12年前 (2012-03-18)回复