If you use key based authentication (without password), scp and sftp tools doesn't work. SFTP returns: Received message too long 1299542900 SCP returns: Must be connected to a terminal.
Nothing in OpenSSH generates that message you report for scp. I suspect what's happening is the remote host is sending something to stdout, and my guess is that it's something like kinit trying to ask for a password and failing. Does ssh yourserver true generate any output? If so, you need to fix that on the server. $ perl -e 'printf "%x\n", 1299542900' 4d757374 $ perl -e 'printf "%c%c%c%c\n", 0x4d, 0x75, 0x73, 0x74' Must So the sftp one is probably the same message as the scp one.
On remote host runs OpenSSH 5.1p1 (Debian Lenny). SSHd configuration is default except Port and AllowUsers directives. SSH login into remote host works. SFTP/SCP connection doesn't work.
(In reply to comment #2) > On remote host runs OpenSSH 5.1p1 (Debian Lenny). SSHd configuration is > default except Port and AllowUsers directives. SSH login into remote > host works. SFTP/SCP connection doesn't work. You did not answer my question: does "ssh yourserver true" generate any output? With or without public-key authentication?
Both methods returns "Must be connected to a terminal.". I guess command true needs a terminal to be openned (ssh -t). But how is this connected to scp and sftp? Scp and sftp doesn't work when key authentication is neabled. True doesn't work in both cases.
(In reply to comment #4) > Both methods returns "Must be connected to a terminal.". I guess > command true needs a terminal to be openned (ssh -t). No, it doesn't. "true" returns no output at all, which proves that your problem is caused by something on the remote system polluting stdout. It's probably either something in the PAM stack, or something in the shell startup. Either way, it's not a problem with OpenSSH. > But how is this connected to scp and sftp? Scp and sftp doesn't work > when key authentication is neabled. True doesn't work in both cases. Fix whatever caused ssh'ing to generate spurious output on stdout. When you've fixed that, as proven by "ssh yourserver true" generating no output, scp and sftp will start working.
I disabled PAM (UsePAM no) and bug still persists. Looks like Debian bug so I will report it to Debian bugzilla. Thank you very much for your help!
Thanks, closing. I would be taking a good long look at what you have in your .profile or other shell startup files first before filing a bug against debian, though.
I am spilling ashes on my head. You are totaly right. I forgot screen invocation in my bashrc :( Thank you
Mass move of bugs RESOLVED->CLOSED following the release of openssh-5.5p1