OpenSSH-2.5.1p1 scp hangs when scping into an RH (6.0|7.0) box

Jim Breton vader at conflict.net
Thu Feb 22 06:30:06 EST 2001


On Wed, Feb 21, 2001 at 12:48:25PM -0600, mouring at etoh.eviladmin.org wrote:
> > In addition to the aforementioned issues, I also cannot do this:
> > 
> > ssh hostname "cat > filename" < filename
> 
> I can't replicate this on Redhat 7.0.  What is the actual error
> message? (if any) and a ssh -v -v -v may help also.

There is no error message.  ssh -v -v -v output will be at the end of my
message.


> > which is what I had been using as a work-around to the broken scp in
> > OpenSSH-2.3.0.  This now also seems broken in 2.5.1 in some cases.
> > 
> Which?  scp? or the above cat?

Both.  My first post was about scp which produces no useful output no
matter how many -v args I use (which is why I didn't include it) but
just today I found that stdin over ssh is also troublesome.


> scp should work fine since we reverted out
> of an attempt to fix a Linux select() issue.

Not for me.  :-\  Hopefully the output (below) will help.


> > I have a question if someone doesn't mind answering: does scp do exactly
> > the same thing as piping a file over ssh's stdin would do?  In other
> > words, is it just a front-end to setting up stdin/stdout on an ssh
> > process?
> > 
> 
> They should (in theory) be roughtly the same.  

K thanks.


>    I have tested this and it does resolve the hanging at logout without  
>    causing race conditions. I now have a "shopt -s huponexit" in my      
>    /etc/bashrc and it works beautifully.                                 

Pekka Savola also noted this in his response (I'm reading it out of the
archives).  Didn't do the job for me, though.

Here's a sample session of each, scp and ssh.  Note that this happens
whether using key-auth or password-auth.


~$ shopt -s huponexit
~$ shopt huponexit
huponexit      	on

$ ls -l filelist 
-rw-r-----    1 jamesb   jamesb     345529 Feb 18 17:01 filelist

$ scp -v -v -v filelist jimb at crate:
Executing: program /usr/local/openssh/bin/ssh host crate, user jimb,
command scp -v -t .

(hangs for a LONG time.. finally kill it with ctrl+c... sshd process
stays alive on server)

$ ssh -v -v -v crate "cat > filelist" < filelist 
OpenSSH_2.5.1p1, SSH protocols 1.5/2.0, OpenSSL 0x0090581f
debug: Reading configuration data /home/jamesb/.ssh/config
debug: Applying options for *
debug: Applying options for crate
debug: Reading configuration data /usr/local/openssh/etc/ssh_config
debug: Applying options for *
debug: Rhosts Authentication disabled, originating port will not be
trusted.
debug: ssh_connect: getuid 1000 geteuid 1000 anon 1
debug: Connecting to crate [ip] port 22.
debug: Connection established.
debug: identity file /home/jamesb/.ssh/identity type 0
debug: Bad RSA1 key file /home/jamesb/.ssh/id_dsa.
debug: identity file /home/jamesb/.ssh/id_dsa type 3
debug: identity file /home/jamesb/.ssh/id_rsa1 type 3
debug: identity file /home/jamesb/.ssh/id_rsa2 type 3
debug: Remote protocol version 1.99, remote software version
OpenSSH_2.5.1p1
debug: match: OpenSSH_2.5.1p1 pat ^OpenSSH
Enabling compatibility mode for protocol 2.0
debug: Local version string SSH-2.0-OpenSSH_2.5.1p1
debug: Seeding random number generator
debug: send KEXINIT
debug: done
debug: wait KEXINIT
debug: got kexinit:
diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug: got kexinit: ssh-dss
debug: got kexinit:
3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,rijndael-cbc at lysator.liu.se
debug: got kexinit:
3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes128-cbc,aes192-cbc,aes256-cbc,rijndael128-cbc,rijndael192-cbc,rijndael256-cbc,rijndael-cbc at lysator.liu.se
debug: got kexinit:
hmac-sha1,hmac-md5,hmac-ripemd160,hmac-ripemd160 at openssh.com,hmac-sha1-96,hmac-md5-96
debug: got kexinit:
hmac-sha1,hmac-md5,hmac-ripemd160,hmac-ripemd160 at openssh.com,hmac-sha1-96,hmac-md5-96
debug: got kexinit: none,zlib
debug: got kexinit: none,zlib
debug: got kexinit: 
debug: got kexinit: 
debug: first kex follow: 0 
debug: reserved: 0 
debug: done
debug: mac_init: found hmac-sha1
debug: kex: server->client 3des-cbc hmac-sha1 zlib
debug: mac_init: found hmac-sha1
debug: kex: client->server 3des-cbc hmac-sha1 zlib
debug: Sending SSH2_MSG_KEX_DH_GEX_REQUEST.
debug: Wait SSH2_MSG_KEX_DH_GEX_GROUP.
debug: Got SSH2_MSG_KEX_DH_GEX_GROUP.
debug: bits set: 1021/2049
debug: Sending SSH2_MSG_KEX_DH_GEX_INIT.
debug: Wait SSH2_MSG_KEX_DH_GEX_REPLY.
debug: Got SSH2_MSG_KEXDH_REPLY.
debug: Host 'crate' is known and matches the DSA host key.
debug: Found key in /home/jamesb/.ssh/known_hosts2:27
debug: bits set: 1026/2049
debug: len 55 datafellows 0
debug: ssh_dss_verify: signature correct
debug: Wait SSH2_MSG_NEWKEYS.
debug: Enabling compression at level 6.
debug: GOT SSH2_MSG_NEWKEYS.
debug: send SSH2_MSG_NEWKEYS.
debug: done: send SSH2_MSG_NEWKEYS.
debug: done: KEX2.
debug: send SSH2_MSG_SERVICE_REQUEST
debug: service_accept: ssh-userauth
debug: got SSH2_MSG_SERVICE_ACCEPT
debug: authentications that can continue:
publickey,password,keyboard-interactive
debug: start over, passed a different list
debug: authmethod_lookup publickey
debug: authmethod_is_enabled publickey
debug: next auth method to try is publickey
debug: try pubkey: /home/jamesb/.ssh/id_dsa
debug: read SSH2 private key done: name dsa w/o comment success 1
debug: sign_and_send_pubkey
debug: sig size 20 20
debug: we sent a publickey packet, wait for reply
debug: ssh-userauth2 successful: method publickey
debug: fd 4 setting O_NONBLOCK
debug: channel 0: new [client-session]
debug: send channel open 0
debug: Entering interactive session.
debug: callback start
debug: client_init id 0 arg 0
debug: Sending command: cat > filelist
debug: callback done
debug: channel 0: open confirm rwindow 0 rmax 16384
debug: channel 0: chan_delete_if_full_closed2: istate 1 ostate 16
debug: channel 0: chan_delete_if_full_closed2: istate 1 ostate 16
debug: channel 0: chan_delete_if_full_closed2: istate 1 ostate 16

-- 

Jim B.
vader at conflict.net





More information about the openssh-unix-dev mailing list