LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 01-04-2010, 01:31 PM   #1
protos78
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Rep: Reputation: 0
sftp issue on rhel 5.4


Hello,

We have RHEL 5.4 server and use it for transferring files via ftp. The problem is unique to one user. FTP connection is closed immediately when user connects to the server. It is possible to move files back and forth when server and client is linux. However, windows can't keep the ftp connection alive. The strange thing is that logs show that connection is established, however, it ceases immediately. Here is the part of /var/log/secure

Jan 4 11:59:26 helios sshd[8208]: subsystem request for sftp
Jan 4 11:59:26 helios sshd[8206]: pam_unix(sshd:session): session closed for user xxx

I changed the user's name to xxx.

We use secureFX on windows client. Here is the log:

i Changing state from STATE_EXPECT_KEX_INIT to STATE_KEY_EXCHANGE
i SEND : KEXDH_GEX_REQUEST
i RECV : KEXDH_GEX_GROUP
i SEND : KEXDH_INIT
i RECV : KEXDH_REPLY
i SEND : NEWKEYS
i Changing state from STATE_KEY_EXCHANGE to STATE_EXPECT_NEWKEYS
i RECV : NEWKEYS
i Changing state from STATE_EXPECT_NEWKEYS to STATE_CONNECTION
i SEND: SERVICE_REQUEST[ssh-userauth]
i RECV: SERVICE_ACCEPT[ssh-userauth] -- OK
i SENT : USERAUTH_REQUEST [none]
i RECV : USERAUTH_FAILURE, continuations [publickey,gssapi-with-mic,password]
i SENT : USERAUTH_REQUEST [password]
i RECV : AUTH_SUCCESS
i Channel Closed: 00000000 (The operation completed successfully. )


I have no idea why connection is closed immediately. Again, this just happens on one user. Other users can establish ssh connection to ftp server.

Thanks for interest beforehand.
 
Old 01-04-2010, 02:37 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
well what does the server side logs say? /var/log/messages is your best bet but check others too.
 
Old 01-05-2010, 05:20 AM   #3
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
SFTP is NOT a FTP program. It creates SSH connections to download files. try loging in via ssh and see if same thing happens. Also try other SFTP client and/or on another machine if ssh conection does not brake for the same user.
 
Old 01-05-2010, 06:12 AM   #4
bsnithin
LQ Newbie
 
Registered: Jan 2010
Posts: 4

Rep: Reputation: 0
I do see you are having SFTP server & not FTP server. Linux/Unix OS provide default SFTP clients.For Windows, you can use any other free SFTP clients like WinSCP, PSFTP (comes with putty installer) & try. I see no issues with SFTP software as it is working fine when connected from Linux box.

Last edited by bsnithin; 01-05-2010 at 08:08 AM.
 
Old 01-05-2010, 08:26 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
The user clearly IS using SFTP, not FTP. The logs clearly show SSH key exchanges.

I missed that he did mention /var/log/secure TBH too though...

Last edited by acid_kewpie; 01-05-2010 at 08:28 AM.
 
Old 01-05-2010, 02:35 PM   #6
protos78
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
The user clearly IS using SFTP, not FTP. The logs clearly show SSH key exchanges.

I missed that he did mention /var/log/secure TBH too though...
Sorry for the misleading comment about FTP. We connect to the server with SFTP.

Another user started to have exactly the same problem. /var/log/messages shows nothing regarding connection problem.

Quote:
Originally Posted by DrLove73 View Post
SFTP is NOT a FTP program. It creates SSH connections to download files. try logging in via ssh and see if same thing happens. Also try other SFTP client and/or on another machine if ssh connection does not brake for the same user.
I can log into to the server via putty from windows machine. Another linux box can also ssh into server. The problem is specific to windows client -linux server sftp connection. It happens only for two users. I am using secureFx on windows clients. I tried to establish sftp connection with 3 windows clients. None worked so far for two users. However, it works for my own linux account.

The problem is not due to windows client. Because, I can sftp to a linux server from a windows desktop using my own linux user account.

The issue is specific to two users and windows clients. The user accounts which have the problem can establish sftp connection to another linux server.

Thanks,

Last edited by protos78; 01-05-2010 at 02:45 PM.
 
Old 01-05-2010, 02:46 PM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Hmm, ok can we rule some things in and out then? are the affected users local accounts to that box? are the working ones? ssh logins still work? Are the entries in passwd and shadow (assuming local) still fully valid and consistent with other users? can you try winscp or filezilla?
 
Old 01-05-2010, 10:01 PM   #8
DrLove73
Senior Member
 
Registered: Sep 2009
Location: Srbobran, Serbia
Distribution: CentOS 5.5 i386 & x86_64
Posts: 1,118
Blog Entries: 1

Rep: Reputation: 129Reputation: 129
Quote:
Originally Posted by acid_kewpie View Post
...can you try winscp or filezilla?
This would be my suggestion. Winscp is in my oppinion the best SCP/SFTP client for Windows.
 
Old 01-06-2010, 03:04 PM   #9
protos78
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
Hmm, ok can we rule some things in and out then? are the affected users local accounts to that box?
yes, they are.

Quote:
Originally Posted by acid_kewpie View Post
are the working ones? ssh logins still work?
All users can connect to the server via ssh.

Quote:
Originally Posted by acid_kewpie View Post
Are the entries in passwd and shadow (assuming local) still fully valid and consistent with other users?
I run pwck and checked shadow manually. They are fine.

Quote:
Originally Posted by acid_kewpie View Post
can you try winscp or filezilla?
sftp for affected users don't work with winscp and filezilla. However, scp in winSCP works fine.

Thanks,
 
Old 01-06-2010, 03:59 PM   #10
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
I'm curious to know whether all users (working and borked) have the same login shell. Check /etc/passwd again if you're unsure.

Failing that, I still think this is a client-side software issue. Here are the facts as I understand them:
  • sftp does not work for two users (from their workstations?)
  • sftp does work for at least one user (you), from your workstation, using any of secureFX, WinSCP, or putty

Time to start eliminating possibilities more drastically. Can the borked users sftp in from your workstation, using your different sftp client apps? Can you sftp in as one of the borked users from a Linux terminal? Can you sftp in, as you, from one of the borked users' workstations?
 
Old 01-11-2010, 05:30 PM   #11
protos78
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by anomie View Post
I'm curious to know whether all users (working and borked) have the same login shell. Check /etc/passwd again if you're unsure.
Yes, it is bash.
Quote:
Originally Posted by anomie View Post
  • sftp does not work for two users (from their workstations?)
  • correct. Their computer is windows.
    Quote:
    Originally Posted by anomie View Post
  • sftp does work for at least one user (you), from your workstation, using any of secureFX, WinSCP, or putty
correct

Quote:
Originally Posted by anomie View Post
Time to start eliminating possibilities more drastically. Can the borked users sftp in from your workstation, using your different sftp client apps?
No. Those users can't sftp into server no matter what windows software or workstation is used.
All users can sftp into server from a linux machine.

Quote:
Originally Posted by anomie View Post
Can you sftp in as one of the borked users from a Linux terminal?
yes.
Quote:
Originally Posted by anomie View Post
Can you sftp in, as you, from one of the borked users' workstations?
I can sftp into server from linux or windows workstations (including those two users's PC) without a problem. THe client application for my own user account doesn't matter. I can always sftp into server with my own user account.

Let me rephrase the whole issue one more time:

2 users can't sftp into server from windows computers no matter what client application they use. Others can sftp into server from linux and windows computer.

When one of the users try to sftp into server from a windows computer, they get the following error: Server sent command exit status 128

Last edited by protos78; 01-11-2010 at 05:45 PM.
 
Old 01-11-2010, 06:30 PM   #12
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Ay, caramba. What a strange mess. How about creating them new accounts? Let them get on with their work while you continue to troubleshoot cause and effect.
 
Old 01-12-2010, 03:47 PM   #13
protos78
LQ Newbie
 
Registered: Feb 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by anomie View Post
Ay, caramba. What a strange mess. How about creating them new accounts? Let them get on with their work while you continue to troubleshoot cause and effect.
Winscp's scp is still working fine. They can backup their own data.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SFTP fails from RHEL 4.6 AS to Windows 2003 Server running WS_FTP valen_tino Red Hat 7 04-06-2009 02:24 PM
Question on creating SFTP user in RHEL 4.0 a2vr6 Linux - Security 3 07-23-2008 01:07 PM
How do I use sftp to upload my web site? (no sftp tar command) johnMG Linux - Networking 6 06-21-2005 10:14 PM
RHEL 3 AS U4 Issue alexander_goron LinuxQuestions.org Member Success Stories 0 04-12-2005 10:52 PM
Files truncated by sftp/sftp-server at 65kb gato Linux - Networking 1 12-18-2003 11:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 05:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration