WinSCP 必须不断重新连接到我的 Ubuntu 服务器

WinSCP 必须不断重新连接到我的 Ubuntu 服务器

我在 Windows 7 机器上,所以我只能使用 WinSCP 之类的工具来管理运行 Ubuntu 的远程服务器。

我也确实使用了好的老式命令行,但对于文件管理,我通常使用 WinSCP,它是一个很好的工具,可以充当 FTP 客户端,但我相信它是通过 SSH 或 SFTP 运行的。

现在,有些事情真的很烦人,如果在闲置 10-20 分钟后(我不知道实际时间),当我通过 WinSCP 传输文件时,它必须重新连接,这是一个快速的过程,不会再次要求我输入密码或密钥文件...但似乎它超时或断开连接到某个点...我不确定它是否真的断开连接,因为它喜欢立即重新连接,但它确实需要 15-30 秒,这很烦人。

我很想找到一种方法,使它总是快速而敏捷,就好像我一直连接着一样,而不是像空闲一段时间后那样超时。

所以我想问,这可能是 WinSCP 中的设置或问题,还是更有可能是我的服务器中的设置?

关于如何延长其保持登录的时间而无需一直重新连接,有什么想法吗?

我看到某处可以找到 SSH 配置文件,因此我sshd_configetc/ssh/sshd_config下面的内容中找到了此文件,我没有看到任何对我来说突出的东西(没有多说)...

LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

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

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes

答案1

最有可能的是,您的系统和远程系统之间有一个状态防火墙/NAT,它会在 15/20 分钟后使您的连接状态数据超时。修改客户端中的 keepalive 设置。我通常使用 120 秒的值。

修改导致问题的防火墙/nat 设备也是可能的,但可能会产生其他副作用。

打开以下对话框会议/网站/网站管理员

winscp 保持活动

相关内容