LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   SFTP fails from RHEL 4.6 AS to Windows 2003 Server running WS_FTP (https://www.linuxquestions.org/questions/red-hat-31/sftp-fails-from-rhel-4-6-as-to-windows-2003-server-running-ws_ftp-716323/)

valen_tino 04-02-2009 08:51 AM

SFTP fails from RHEL 4.6 AS to Windows 2003 Server running WS_FTP
 
Folks,

When I try to sftp from a particular RHEL 4.6 AS client to a Windows 2003 Server on our network running WS_FTP, I get the following error.

$ sftp <user>@<sftp_server>
Connecting to <sftp_server>...
ssh_exchange_identification: Connection closed by remote host
Couldn't read packet: Connection reset by peer

This client can connect to external ftp sites. There is no firewall between the client and server and we do not have IPTables enabled on the client. We have other clients that run a similar version of RHEL and they run without any problems. I don't see anything peculiar with this particular client or perhaps I am not looking in the right place.

Any leads would be appreciated. Thanks!

acid_kewpie 04-02-2009 09:02 AM

nothing there really, anythign on the server side? try adding some -v's to the command line.

valen_tino 04-02-2009 09:15 AM

Well, I inserted the -v switch and I get the following:

# sftp -v <user>@<server_name>
Connecting to <server_name>...
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /root/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to <server_name> <[ip_address]> port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type 1
ssh_exchange_identification: Connection closed by remote host
Couldn't read packet: Connection reset by peer

acid_kewpie 04-02-2009 09:29 AM

still clearly nothing useful, add another, but fi the server is closing the connection, then there really shuld be something on their side. Check the logs there.

valen_tino 04-02-2009 10:05 AM

# sftp -vvv <user>@<server_name>
Connecting to cob-sftpp-01...
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /root/.ssh/config
debug1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to <server_name> <[ip_address]> port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug3: Not a RSA1 key file /root/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /root/.ssh/id_rsa type 1
ssh_exchange_identification: Connection closed by remote host
Couldn't read packet: Connection reset by peer

chrism01 04-03-2009 07:28 PM

Quote:

debug2: key_type_from_name: unknown key type '-----BEGIN'
.
.
.
debug2: key_type_from_name: unknown key type '-----END'
means key has been corrupted/overwritten.
Hopefully not a hack attack, but you need to re-generate this key.
I'd check all the keys you have in case they have issues too.

valen_tino 04-06-2009 09:06 AM

Thanks for the reply. I did try to regenerate the keys with ssh-keygen -t rsa, however that did not help either and the problem persists.

The one thing that I noticed on another linux client on which sftp runs fine was that the ~/.ssh folder did not contain any keys (rsa or dsa). So my understanding is that for the sftp process, key generation is not a necessity; however, as a rule of thumb, the process checks the integrity of the keys present in ~/.ssh. Is it safe for me to assume that?

acid_kewpie 04-06-2009 01:24 PM

Yes, those keys are only needed for private key authentication, not password authentication.


All times are GMT -5. The time now is 11:29 PM.