sftp connection closes if idle for around 10minutes


 
Thread Tools Search this Thread
Operating Systems Solaris sftp connection closes if idle for around 10minutes
# 1  
Old 06-15-2012
sftp connection closes if idle for around 10minutes

does sftp connection closes by default if it stays idle for a prolonged time ?

i have checked sshd_config files , there is no time out value set. but still the connection closes after certain period of time.

Please help.

verbose mode output :

Code:
sftp> debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Connection to [x.x.x.x] closed by remote host.
debug1: Transferred: stdin 0, stdout 0, stderr 53 bytes in 600.6 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.1
debug1: Exit status -1

# 2  
Old 06-15-2012
Take a look at the ServerAliveInterval option to sftp\ssh.

Hope this helps.
# 3  
Old 06-15-2012
oops. no such option in sshd_config file
# 4  
Old 06-15-2012
Have a look here - OpenSSH FAQ
Search for ServerAliveInterval.
# 5  
Old 06-15-2012
ok i need to try that out and see , i have one more query.

In the below output exit status is -1 and stderr 0.1 is this normal or any issues ?

because the sftp happens through a cron job and sometimes the sftp seems to fail.

Code:
sftp> debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Connection to [x.x.x.x] closed by remote host.
debug1: Transferred: stdin 0, stdout 0, stderr 53 bytes in 600.6 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.1
debug1: Exit status -1


The destination server is out of network , and doesnt not allow ping , even ssh. only sftp works with a specific port number.

so we experience this connection drop at times and we need to find out why this happens.
# 6  
Old 06-15-2012
That look likes an error, but I'm not sure what that is.

If there is a Firewall in the middle that doesn't allow SSH session, SFTP will not work. SSH File Transfer Protocol - Wikipedia, the free encyclopedia

SFTP uses Port 22.

-----------------------------edit

Sorry didn't see that you are using a specific port.
Anyway check with the Firewall guys, maybe they can see anything more then we could.
# 7  
Old 06-15-2012
well we checked and they could not find any error. Problem is the sftp connection does not close always. it happens sometime in a day , doesnt have any pattern , but happens . We got a suggestion of using tcpdump to monitor the connectivity but ours is a solaris box. so i believe we have to go with snoop.
can someone help with how to use snoop in this issue
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Telnet connection closes before i execute GET command

I tried the below steps for telnet command from a remote server: 1. telnet myservice.com 443 2. GET / HTTP/1.0 3. Press enter key twice Please see the output below: bash-3.2$ hostname remoteserver1 bash-3.2$ telnet myservice.com 443 Trying 191.172.172.133... Connected to... (7 Replies)
Discussion started by: mohtashims
7 Replies

2. Shell Programming and Scripting

Sftp connection with password

I am running this script to copy pattern files in local but it is asking for password even passing the hardcode value Script:- PASSWORD="xyz" sftp -oport=1002 user@host:/dir/archive/file*.txt /di/data/ << EOF $PASSWORD quit EOF Got error :- -bash-4.1$ sh sftp_with_password.sh... (5 Replies)
Discussion started by: himanshupant
5 Replies

3. Red Hat

New sftp connection

Dear All , I have a openssh 4.3p2 , but i need to configure sftp for a user which is present in the server. This user has to see only the specific directory not all. I tried to do the changes in sshd_config for openssh 4.9p1 , but for openssh 4.3p2 how to do it. Any one pl help. ... (1 Reply)
Discussion started by: jegaraman
1 Replies

4. IP Networking

SFTP connection using two different users

Hi All This is regarding an SFTP Password less connection. I am logged into my local Server1 using username1. The remote server i have to connect is "Remoteserver1" with the "useriD" provided. I have already exchanged the public key and they are added to the authorized keys in the remote... (2 Replies)
Discussion started by: sparks
2 Replies

5. UNIX for Dummies Questions & Answers

SFTP: Connection problem

HI, I have generated public key and placed in remote server. When I am trying to do SFTP for that remote server the below error I am getting. Please help me to resolve Connecting to hostname... Sun_SSH_1.1.4, SSH protocols 1.5/2.0, OpenSSL 0x0090704f debug1: Reading configuration data... (4 Replies)
Discussion started by: rangarasan
4 Replies

6. SuSE

NoMachine NX window closes after establishing connection

Hi, I am trying to use nomachine nx server and client. But somehow it doen't work. What happens is the following: 1.- Client starts up 2.- Client authenticates with Server 3.- The NoMachine window appears for 2-4 seconds 4.- The NoMachine window exists Somehow a "closeEvent" is sent.... (3 Replies)
Discussion started by: blackicecube
3 Replies

7. Shell Programming and Scripting

SFTP connection problem

Dear All, I'm trying to configure the passwordless connection between two servers say Server A and Server B. My requirement is a passwordless connection from Server A to Server B. I have done the configuration in both the servers. In Server A its successfull but from Server B its everytime... (7 Replies)
Discussion started by: panknil
7 Replies

8. UNIX for Advanced & Expert Users

SSH closes connection when using arrow keys

Hi, I'm having a problem with my ssh link to various Sun servers running Solaris 9 and 10 from an Windows XP box running Cygwin/X. I am using ssh to connect to a number of different Sun servers. My problem is that when editing a remote shell command line with the arrow direction keys the... (0 Replies)
Discussion started by: stv_t
0 Replies

9. UNIX for Advanced & Expert Users

SFTP Connection Closed

Hey when trying to connect to a server using a key I get sftp -o 'Port=22' -o'IdentityFile=/home/datatel/.ssh/id_dsa_xei' becker_xei@host Connecting to host... ANGEL SFTP ServerConnection closed by host Connection closed Any ideas? (1 Reply)
Discussion started by: ed.browne
1 Replies

10. Programming

multiuser chat server closes when one client closes. code included

I have been trying to write a very basic chat program but at the moment I am having problems getting it to be multiuser as it closes all connections when one client shutsdown. I have also been having problems trying to get the program to display a list of usernames to the clients. I have tried... (0 Replies)
Discussion started by: dooker
0 Replies
Login or Register to Ask a Question