SFTP. ls and get hangs.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users SFTP. ls and get hangs.
# 1  
Old 02-13-2012
SFTP. ls and get hangs.

Hello I have a sftp problem.

If I do sftp between some nodes that we installed it works fine i can list
directories and get files.

If I connect with sftp from the other side of a firewall (wich has port 22 open)
I can log in and cd to which ever direcory i want i can do pwd but when i do ls or get it hangs and the client never times out ( waited 30 minutes).
If i do ls in a empty directory it works but ls or get in a directory with files hangs.
I know that plain ftp use control and data port but sftp is just port 22 isnt it?
SSH to the same account and list files works fine.


Any hints?
Thanks Jan
# 2  
Old 02-13-2012
It's odd that ssh should work while sftp doesn't since yes, they are the same protocol.

Might you have an MTU problem? packets too large getting silently dropped instead of giving proper ICMP responses? So communication with small packets succeeds fine but long packets lags...
# 3  
Old 02-14-2012
Thanks for the tip about MTU size.
I changed it and it works.

BUT I know that some people says that changing MTU size could create other problems.
Sorry but im not to familiar with what problem could raise from changin MTU size.

Anyone have a point of view over this?
# 4  
Old 02-14-2012
Your MTU has to match your network's, or else you'll get problems like you had. I had to deal with a crazy and embedded DHCP server which kept giving MTU's of 600, and had to pin the value manually to something sane on all hosts...

Except, usually, MTU handles itself, via ICMP replies. When you send a packet that's too large and nothing on the way can fragment it, you get an ICMP reply about too-large packets, instructing the sending host to send smaller packets.

Your firewall or someone else's is improperly blocking ICMP, preventing this autocorrection measure from working, meaning you have to get the value of MTU exactly right or things may break.

What did you set your MTU to?
# 5  
Old 02-16-2012
Hi the issue is solved many thanks.

First I and the customer changed the mtu to1300
Code:
ifconfig e1000g1 mtu 1300

and that solved the problem.

Later workmates argued that changing MTU could have negative effects so I set the original mtu again and changed the tcp_mss_max parameter instead.
Code:
ndd -set /dev/tcp tcp_mss_maxipv4 1300
ndd -set /dev/tcp tcp_mss_maxipv6 1300


to see the value do
Code:
ndd -get /dev/tcp tcp_mss_maxipv4

The tcp_mss_max value sets the max tcp packet size. (im not sure that its the correct term) and Im pretty sure that its not the same as changing MTU altough many people thinks so. End result seems to be the same.

This solved the problem for me.

Regards
Jan

This User Gave Thanks to vettec3 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sftp : not able to print the echo statements after the sftp transfer

I had the below sftp script working perfectly but the problem is I am not able to send the echo statements . #!/bin/sh echo "Starting to sftp..." sftp admin@myip << END_SCRIPT cd /remotepath/ lcd /localpath/ mget myfiles*.csv bye END_SCRIPT echo "Sftp successfully." echo echo... (11 Replies)
Discussion started by: scriptscript
11 Replies

2. IP Networking

SFTP hangs

Ok sftp connects but hangs after I enter the password manually The ssh version is 1.0 bash-2.05$ ssh -V SSH Version Sun_SSH_1.0, protocol versions 1.5/2.0. When I go from solaris 9 to sftp to another server with latest proftpd version it hangs after the password. proftpd -V Compile-time... (6 Replies)
Discussion started by: slufoot80
6 Replies

3. Red Hat

Xrdp hangs

Hi, I'm trying to get xrdp to work. I installed xrdp 0.5.0 from EPEL and the Desktop group. Now I can connect to the server with rdesktop, but I can't do any input... there is an authentication window asking the root password "to set the network proxy used for downloading packages" and I can't... (0 Replies)
Discussion started by: FrankVanDamme
0 Replies

4. Red Hat

Chroot sftp users, remote sftp login shows wrong timestamp on files

Hello, I have a weird issue, I have RHEL 5.7 running with openssh5.2 where sftpgroup OS group is chroot. I see the difference difference in timestamp on files, when I login via ssh and SFTP, I see four hour difference, is something missing in my configuration. #pwd... (8 Replies)
Discussion started by: bobby320
8 Replies

5. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

6. Shell Programming and Scripting

sftp from solaris to windows 2008 hangs

Hi All,Our sftp connection from Solaris to windows 2008 hangs with following verbose output. From the output I can see that the connection itself ( key matching ) is successful , but I can't see sftp prompt.Sun_SSH_1.1.3, SSH protocols 1.5/2.0, OpenSSL 0x0090704f debug1: Reading configuration data... (1 Reply)
Discussion started by: rahulkav
1 Replies

7. Shell Programming and Scripting

SFTP HANGS

Hi , we are writing a shell script to test connection of our destination servers and facing an issue if the destination server doesnt respond. we are using the following command., sftp -B /dev/fd/0 <host@servername> << EOF >> file.txt quit EOF --------- The above command hangs for 20min and... (0 Replies)
Discussion started by: mohanpadamata
0 Replies

8. Solaris

Explorer hangs

Hi Guys, Anyone encontered a problem where when you run your SUN explorer, it hangs at sysconfig? I am having this problem for some of my servers. rgds, (1 Reply)
Discussion started by: ronny_nch
1 Replies

9. Red Hat

ls hangs on a directory

Running Red Hat Enterprise Linux Server release 5.1 (Tikanga) 2.6.18-53.el5 Trying to do an 'ls' of a sub-directory and the prompt never returns. Same problem running a find command as well. I have done an fsck on the file system (no problems) and can view other sub-directories on this... (5 Replies)
Discussion started by: wazzu62
5 Replies

10. Windows & DOS: Issues & Discussions

WRQ Reflection SFTP process hangs when run using windows scheduler

Hi I am doing development on .net framework on Win 2003 box. I am scheduling a job using Windows scheduler to kick off SFTP of files from a local directory to a remotre Unix box. I am using WRQ Reflection Multihost v12.0.7 standard edition for this. Here is how we are scheduling the thing.... (0 Replies)
Discussion started by: kapilash
0 Replies
Login or Register to Ask a Question