Putty SSH 不断连长连接配置

找了网络上多个版本的教程都没生效,最后加了几个配置,也不确定是哪个配置导致的长连接。

估计是“Protocol 2”

大家可以直接使用该配置即可:

vim /etc/ssh/sshd_config
# 添加如下配置
#       $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

#Include /etc/ssh/sshd_config.d/*.conf

Port 22
Protocol 2
AddressFamily any

HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key

UsePrivilegeSeparation yes

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:

LoginGraceTime 120
PermitRootLogin yes
StrictModes yes




# To disable tunneled clear text passwords, change to no here!
PermitEmptyPasswords no

ChallengeResponseAuthentication no
UsePAM yes


X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

PrintMotd no
PrintLastLog yes
TCPKeepAlive yes

#Compression delayed
ClientAliveInterval 60
ClientAliveCountMax 3


# no default banner path
#Banner none

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# override default of no subsystems
Subsystem       sftp    /usr/lib/openssh/sftp-server
/etc/init.d/ssh restart

其他参考:

reference

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值