#244924 ssh: scp only prints file modes and exits with status 1

Package:
ssh
Source:
openssh
Description:
secure shell client and server (metapackage)
Submitter:
Marc Langer
Date:
2025-08-17 17:47:14 UTC
Severity:
normal
Tags:
#244924#5
Date:
2004-04-20 17:24:23 UTC
From:
To:
When using scp, it only prints file modes and then exits with status 1.
Its the same in the other direction and also happens when using IPv4.

Executing: program /usr/bin/ssh host gandalf, user (unspecified), command scp -v -f Adressliste
OpenSSH_3.8p1 Debian 1:3.8p1-3, SSH protocols 1.5/2.0, OpenSSL 0.9.7d 17 Mar 2004
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to gandalf [2001:14d8:10::1] port 22.
debug1: Connection established.
debug1: identity file /home/marc/.ssh/identity type 1
debug1: identity file /home/marc/.ssh/id_rsa type -1
debug1: identity file /home/marc/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.8p1 Debian 1:3.8p1-2.backports.org.1
debug1: match: OpenSSH_3.8p1 Debian 1:3.8p1-2.backports.org.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.8p1 Debian 1:3.8p1-3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'gandalf' is known and matches the RSA host key.
debug1: Found key in /home/marc/.ssh/known_hosts:51
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/marc/.ssh/identity
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: scp -v -f Adressliste
Sending file modes: C0600 1374 Adressliste
C0600 1374 Adressliste
marc@dauntless:~$ 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 1.0 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 1

#244924#10
Date:
2004-08-11 09:17:34 UTC
From:
To:
Hello,
I'm having exactly the same problem on my debian unstable.
As this bug report is from april --- is there some solution?
Thanks,
  Armin Straub

#244924#15
Date:
2004-08-11 09:39:36 UTC
From:
To:
scp invokes scp on the remote machine. Is the remote scp normal and
working? What version is it?

The original reporter mentioned a backports.org version on the remote
machine; I've never tried backports.org openssh and am not sure I can
support it.

Cheers,

#244924#20
Date:
2004-08-11 11:58:05 UTC
From:
To:
I just tested it again:

unstable -> unstable: works
unstable -> stable with backports.org: works
stable with backports.org -> unstable: does not work

A few month ago the second case also did not work, as far a I can remember.

I will Cc this mail to Norbert Tretkowski, the backports.org maintainer.

Marc

#244924#25
Date:
2004-08-11 13:11:36 UTC
From:
To:
Hello,
When I tried to use sftp, I got the following error:
"Received message too long ####".

Searching for this error I found the site
http://www.snailbook.com/faq/sftp-corruption.auto.html
which states that there might be some additional output from a shell startup
file. In my case this was

echo -en "\33[11;0]"

which does not produce any visible output, but suppresses bell rings.
Changing this to

if tty -s; then
  echo -en "\33[11;0]"
fi

solved my problem with sftp. And the best: scp works now too!

Perhaps there might be something similar to my problem as the error messages
are exactly the same... one could try sftp too.

A lot of thanks for your fast answers!
Cheers,
  Armin Straub

#244924#30
Date:
2004-08-11 13:30:23 UTC
From:
To:
I had to move my own .bashrc commands into the following predefined if
block, then it worked:

| # If running interactively, then:
| if [ "$PS1" ]; then


Colin: I think the bug can be closed now.

Marc

#244924#37
Date:
2014-08-04 14:01:31 UTC
From:
To:
Dear Maintainer,

I'm seeing the exact behavior described in this bug, but the fix
described here doesn't work for me.

I installed debian testing from the weekly cd image last week.

I'm trying to copy a file to a remote host via scp.  It just prints
the file mode and size and exits with status 1.  Actually, scp is
still running in the background, on both local and remote machines,
though eventually they exit with a 'Write failed: Broken pipe'
message.  Also, the file is created remotely, but is empty.  I am
copying to a fresh CoreOS instance on ec2.  Truncating .bashrc and
.bash_profile on the remote side doesn't help.  I also tried copying
to an old ubuntu lucid instance (to which I've transferred data by scp
successfully from debian stable in the past) with same results.

This is really a showstopper for me.  Any suggestions?

deb8 $ scp -v Dockerfile cw1:.
Executing: program /usr/bin/ssh host cw1, user (unspecified), command scp -v -t .
OpenSSH_6.6.1, OpenSSL 1.0.1i-dev xx XXX xxxx
debug1: Reading configuration data /home/altaurog/.ssh/config
debug1: /home/altaurog/.ssh/config line 26: Applying options for cw1
debug1: /home/altaurog/.ssh/config line 50: Applying options for cw*
debug1: /home/altaurog/.ssh/config line 56: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Hostname has changed; re-reading configuration
debug1: Reading configuration data /home/altaurog/.ssh/config
debug1: /home/altaurog/.ssh/config line 56: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 54.210.152.198 [54.210.152.198] port 22.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: identity file /home/altaurog/.ssh/ubm.pem type -1
debug1: identity file /home/altaurog/.ssh/ubm.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Debian-6
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6p1-hpn14v4
debug1: match: OpenSSH_6.6p1-hpn14v4 pat OpenSSH_6.5*,OpenSSH_6.6* compat 0x14000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ED25519 df:ba:b2:31:e5:43:b8:a8:62:09:89:8f:fe:ed:9b:f6
debug1: Host '54.210.152.198' is known and matches the ED25519 host key.
debug1: Found key in /home/altaurog/.ssh/known_hosts:62
debug1: ssh_ed25519_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/altaurog/.ssh/ubm.pem
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
Authenticated to 54.210.152.198 ([54.210.152.198]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: SSH2_MSG_KEXINIT received
debug1: SSH2_MSG_KEXINIT sent
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ED25519 df:ba:b2:31:e5:43:b8:a8:62:09:89:8f:fe:ed:9b:f6
debug1: Host '54.210.152.198' is known and matches the ED25519 host key.
debug1: Found key in /home/altaurog/.ssh/known_hosts:62
debug1: ssh_ed25519_verify: signature correct
debug1: set_newkeys: rekeying
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: set_newkeys: rekeying
debug1: SSH2_MSG_NEWKEYS received
debug1: tty_make_modes: no fd or tio
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: scp -v -t .
Sending file modes: C0640 1324 Dockerfile
C0640 1324 Dockerfile
deb8 $ echo $?
1

deb8 $ ps -F `pgrep scp`
UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD
altaurog  2883  2756  0  5485  4672   1 10:43 pts/1    00:00:00 -/bin/bash
altaurog 14790     1  0 11058  3208   4 15:46 pts/1    00:00:00 /usr/bin/ssh -x -oForwardAgent=no -oPermitLocalCommand=no -oClearAllForwardings=yes -- cw1 scp -t .
altaurog 14793  2883  0  4771  1284   7 15:46 pts/1    00:00:00 ps -F

deb8 $ ssh cw1 'ls -lA'
total 4
-rw------- 1 core core 272 Aug  4 13:35 .bash_history
-rw-r--r-- 1 core core   0 Aug  4 13:34 .bash_profile
-rw-r--r-- 1 core core   0 Aug  4 13:34 .bashrc
drwx------ 1 core core  64 Aug  4 11:30 .ssh
-rw-r----- 1 core core   0 Aug  4 13:35 Dockerfile

deb8 $ ssh cw 'ps -Fu core'
UID        PID  PPID  C    SZ   RSS PSR STIME TTY          TIME CMD
core      6671  6669  0 16004  3236   0 13:50 ?        00:00:00 sshd: core@pts/0
core      6676  6671  0  2135  1632   0 13:50 pts/0    00:00:00 scp -t .
core      6679  6677  0 16004  3060   0 13:50 ?        00:00:00 sshd: core@pts/1
core      6684  6679  0  3288  1988   0 13:50 pts/1    00:00:00 ps -Fu core

#244924#42
Date:
2014-08-04 14:15:29 UTC
From:
To:
Follow-up:

I downloaded and manually installed the openssh-client from wheezy,
openssh-client_6.0p1-4+deb7u2_amd64.deb, and it works for me with no
other changes.

Aryeh Leib Taurog