Discussion:
Problems with scp against Solaris
(too old to reply)
Jan Danielsson
2006-11-14 13:11:11 UTC
Permalink
Hello all,

What does NetBSD's scp have in common with PuTTY's pscp?

A long time ago (something like two years ago) I could use pscp to
copy files to/from my university account. Suddenly, it stopped working.
pscp asks for my password, I enter it, and then it just sets there..
Doing nothing. Until I kill it manually. WinSCP works fine, though.

Now I have started migrating to my NetBSD system as my primary
desktop, and I thought that since I'm no longer using pscp, I would be
able to copy stuff easily from the command line again.

But to my big surprise, it doesn't work in NetBSD either(!). When I
run scp to copy something, it sits there for a while, prints a fortune,
and then exits -- no files transferred.

Again, WinSCP on my Windows-system works, and it should be noted that
I'm not having any problems with (p)scp (Windows or NetBSD) against any
other sites.

Does anyone recognize this behavior? Was it something I did, or could
the problem be in the Solaris system at the university?
--
Kind regards,
Jan Danielsson
Joerg Sonnenberger
2006-11-14 13:20:38 UTC
Permalink
Post by Jan Danielsson
A long time ago (something like two years ago) I could use pscp to
copy files to/from my university account. Suddenly, it stopped working.
pscp asks for my password, I enter it, and then it just sets there..
Doing nothing. Until I kill it manually. WinSCP works fine, though.
Two important things to try: run with verbose mode (-v) and tcpdump for
the stream. The former can help finding out which part of the connection
it is hanging in and the latter might point to strange TCP problems.

Candidates might be path MTU, SACK blocking etc.

Joerg

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Hubert Feyrer
2006-11-14 13:28:12 UTC
Permalink
Post by Jan Danielsson
Does anyone recognize this behavior? Was it something I did, or could
the problem be in the Solaris system at the university?
I'm using NetBSD's scp from/to Solaris ~forever, and can't remember any
problems that weren't homemade, e.g. by frobbing with stty in
.login/.cshrc on the Solaris side.


- Hubert

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
matthew sporleder
2006-11-14 14:42:19 UTC
Permalink
Post by Hubert Feyrer
Post by Jan Danielsson
Does anyone recognize this behavior? Was it something I did, or could
the problem be in the Solaris system at the university?
I'm using NetBSD's scp from/to Solaris ~forever, and can't remember any
problems that weren't homemade, e.g. by frobbing with stty in
.login/.cshrc on the Solaris side.
I don't even have a .login file. Could this be related to the
problem(s)? I do have a .bash_login, but it is so simple that I doubt it
could be causing much harm. (Famous last words).
Does 'sftp' work? I would guess that you have a screwy ssh_config or
your solaris box has a screwy sshd_config. :)

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Jan Danielsson
2006-11-14 14:36:27 UTC
Permalink
Post by Hubert Feyrer
Post by Jan Danielsson
Does anyone recognize this behavior? Was it something I did, or could
the problem be in the Solaris system at the university?
I'm using NetBSD's scp from/to Solaris ~forever, and can't remember any
problems that weren't homemade, e.g. by frobbing with stty in
.login/.cshrc on the Solaris side.
I don't even have a .login file. Could this be related to the
problem(s)? I do have a .bash_login, but it is so simple that I doubt it
could be causing much harm. (Famous last words).
--
Kind regards,
Jan Danielsson
Christian Biere
2006-11-14 15:00:48 UTC
Permalink
Post by Hubert Feyrer
Post by Jan Danielsson
Does anyone recognize this behavior? Was it something I did, or could
the problem be in the Solaris system at the university?
I'm using NetBSD's scp from/to Solaris ~forever, and can't remember any
problems that weren't homemade, e.g. by frobbing with stty in
.login/.cshrc on the Solaris side.
I don't even have a .login file. Could this be related to the
problem(s)? I do have a .bash_login, but it is so simple that I doubt it
could be causing much harm. (Famous last words).
A simple "echo hi" would break scp, sftp and others. You have to use something
like below to prevent printing anything to the terminal or having stty messing
with it:

if [ -t 0 ]; then
# Interactive stuff goes here like echo, stty etc.
...
fi

Basically, for non-interactive use (scp, sftp) only set environment variables,
umask and ulimit. In the latter case keep in mind that ulimit (implementations
differ anyway) may also print something to the terminal. So whatever program
you run from your login scripts, be sure to redirect standard output and
standard error output to /dev/null, for example,

ulimit -n 32 >/dev/null 2>&1

rather than just

ulimit -n 32
--
Christian

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Jan Danielsson
2006-11-14 15:13:35 UTC
Permalink
Christian Biere wrote:
[---]
Post by Christian Biere
A simple "echo hi" would break scp, sftp and others. You have to use something
like below to prevent printing anything to the terminal or having stty messing
[---]

Ah, I see -- that was it. When I made sure that output only occurs
during interactive login, it worked fine. Many thanks to all who replied
with various ideas. I have learned a lot.
--
Kind Regards,
Jan Danielsson
Te audire non possum. Musa sapientum fixa est in aure.
Manuel Bouyer
2006-11-14 13:41:51 UTC
Permalink
Post by Jan Danielsson
Hello all,
What does NetBSD's scp have in common with PuTTY's pscp?
A long time ago (something like two years ago) I could use pscp to
copy files to/from my university account. Suddenly, it stopped working.
pscp asks for my password, I enter it, and then it just sets there..
Doing nothing. Until I kill it manually. WinSCP works fine, though.
Now I have started migrating to my NetBSD system as my primary
desktop, and I thought that since I'm no longer using pscp, I would be
able to copy stuff easily from the command line again.
But to my big surprise, it doesn't work in NetBSD either(!). When I
run scp to copy something, it sits there for a while, prints a fortune,
and then exits -- no files transferred.
Again, WinSCP on my Windows-system works, and it should be noted that
I'm not having any problems with (p)scp (Windows or NetBSD) against any
other sites.
Does anyone recognize this behavior? Was it something I did, or could
the problem be in the Solaris system at the university?
You says it prints a fortune, this may be a hint.
Does
ssh <solaris box> echo
prints anything ? It should not.
--
Manuel Bouyer, LIP6, Universite Paris VI. ***@lip6.fr
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Jan Danielsson
2006-11-14 14:22:09 UTC
Permalink
Manuel Bouyer wrote:
[---]
Post by Manuel Bouyer
Post by Jan Danielsson
Does anyone recognize this behavior? Was it something I did, or could
the problem be in the Solaris system at the university?
You says it prints a fortune, this may be a hint.
Does
ssh <solaris box> echo
prints anything ? It should not.
It does print a fortune.. :-( You know, I kind of found that
peculiar, since no other server I use scp against exhibits that
behavior, but I assumed there was a good reason I got a fortune through scp.

Does this "fortune" issue bring me any closer to a solution, or does
it merely verify that there indeed is a problem?
--
Kind regards,
Jan Danielsson
Jan Danielsson
2006-11-14 14:31:05 UTC
Permalink
Post by Joerg Sonnenberger
Post by Jan Danielsson
A long time ago (something like two years ago) I could use pscp to
copy files to/from my university account. Suddenly, it stopped working.
pscp asks for my password, I enter it, and then it just sets there..
Doing nothing. Until I kill it manually. WinSCP works fine, though.
Two important things to try: run with verbose mode (-v) and tcpdump for
the stream. The former can help finding out which part of the connection
it is hanging in and the latter might point to strange TCP problems.
This is what "scp -v ..." returns:

[---]
debug1: identity file /home/jan/.ssh/identity type -1
debug1: identity file /home/jan/.ssh/id_rsa type 1
debug1: identity file /home/jan/.ssh/id_dsa type -1
[== very long pause here ==]
debug1: Remote protocol version 1.99, remote software version
OpenSSH_3.6.1p1
debug1: match: OpenSSH_3.6.1p1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.9
NetBSD_Secure_Shell-20050213
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
[---]
debug1: Entering interactive session.
debug1: Sending command: scp -v -t testfile
"Gee, Mudhead, everyone at More Science High has an
$ debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 3.5 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0

(Yes, the "$" in there is my prompt). I know very little about ssh,
scp, etc, but to me It Looks Just Fine, apart from that instead of the
"scp -v -t testfile" command resulting in some highly exciting file
transfer, I get a fortune.
Post by Joerg Sonnenberger
Candidates might be path MTU, SACK blocking etc.
You've lost me. :-) Anyway, my gut feeling is that the problem is on
a much higher level than that. But anyone who trusts my gut feeling is a
complete moron, so I'll be quiet.
--
Kind regards,
Jan Danielsson
Manuel Bouyer
2006-11-14 14:37:06 UTC
Permalink
Post by Jan Danielsson
[---]
Post by Manuel Bouyer
Post by Jan Danielsson
Does anyone recognize this behavior? Was it something I did, or could
the problem be in the Solaris system at the university?
You says it prints a fortune, this may be a hint.
Does
ssh <solaris box> echo
prints anything ? It should not.
It does print a fortune.. :-( You know, I kind of found that
peculiar, since no other server I use scp against exhibits that
behavior, but I assumed there was a good reason I got a fortune through scp.
Does this "fortune" issue bring me any closer to a solution, or does
it merely verify that there indeed is a problem?
You have to find from where it's called (maybe your .profile or .cshrc ?)
and make it appear only if you have a tty.
In a .cshrc it would be something like:
if ($?prompt) then
display fortune
endif
--
Manuel Bouyer, LIP6, Universite Paris VI. ***@lip6.fr
NetBSD: 26 ans d'experience feront toujours la difference
--

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...