WinSCP has to constantly reconnect to my Ubuntu Server

1

1

I am on a Window 7 machine so I am left to using a tool like WinSCP to manage my remote servers which run Ubuntu.

I do use a good old command line too but for file management I generally use WinSCP, it;s a nice tool that acts like an FTP client but I believe it's over SSH or SFTP instead.

Now something that is really annoying and slows me down if after 10-20 minutes ( I have no idea of the actual time) of sitting idle, when I go to transfer a file over WinSCP, it has to like reconnect, it;s a fast process and does not ask me for a password again or a key file...but it seems that it like times out or disconnects to a certain point...i'm not sure if it really is disconnected or not since it like reconnects right away but it does take a good 15-30 seconds which is annoying.

I would love to figure out a way for it to always be fast and snappy as if I had just connected all the time and not timeout like it does after being idle for a while.

So I am asking, is this likely a setting or problem in WinSCP or more likely I think it is a setting in my server?

Any ideas on how to extend the time it stays logged on without it reconnecting all the time?

I saw somewhere to look for a SSH config file so I found this file sshd_config in etc/ssh/sshd_config the content are below, I don't see anything that stands out to myself (not saying much)...

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

JasonDavis

Posted 2014-07-24T17:31:58.377

Reputation: 4 852

Answers

4

Most likely you have a stateful firewall/nat between your system and the remote system that is timing out the state data for your connection after 15/20 minutes. Modify the keepalive setting in your client. A value of 120 seconds is what I usually use.

Modifying the firewall/nat device causing the problem would also be possible, but may have other side effects.

Open the following dialog at Sessions/Sites/Site Manager:

winscp keepalive

Zoredache

Posted 2014-07-24T17:31:58.377

Reputation: 18 453

I'm not sure what program your screenshot is from? It is not in my WinSCP nor my PuTTY. I am running the latest/newests WinSCP. Af for a Firewall of any sort, if one exist at my home, it would have to be built into our DSL modem or Router. IF on the server, then I am not sure about that either, I might have to live with this issue – JasonDavis – 2014-07-24T18:31:13.803

It is from WinSCP. Click the Advanced button from the connection screen. Sorry I clipped out more of the title then I intended. Putty has a similar option. Also under the 'Connection' heading. http://i.stack.imgur.com/lGtXb.png

– Zoredache – 2014-07-24T18:34:29.797

2

WinSCP documentation for this screen: http://winscp.net/eng/docs/ui_login_connection

– Martin Prikryl – 2014-07-24T18:42:29.163

Thanks, I had never even seen this screen as you don't get to it from the main preferences screen...hoping this will help things, thanks for the help! Will do some slooooow test now and see if I notice a difference! If no other viable answers I will select this one =) – JasonDavis – 2014-07-24T19:01:44.570

Found it at Sessions/Sites/Site Manager, then click one of the sites, click Edit button then click Advanced. – zwcloud – 2018-05-06T10:53:23.493

I did it, But not solved disconnecting problem. – QMaster – 2018-05-18T13:24:37.293