1:5.5p1-4ubuntu4 (scp <host>:ns_sys_config) problem

Bug #674390 reported by Damjan Zajc
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
openssh (Debian)
Invalid
Undecided
Mike Mackintosh
openssh (Ubuntu)
Invalid
Low
Mike Mackintosh

Bug Description

My configuration is:
Ubuntu 10.10 (maverick) i386, 2.6.35-22-generic

When I want to download a configuration of device I get a this report (command is: scp -v 172.30.250.14:ns_sys_config test.cfg):

Executing: program /usr/bin/ssh host 172.30.250.14, user (unspecified), command scp -v -f -- ns_sys_config
OpenSSH_5.5p1 Debian-4ubuntu4, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 172.30.250.14 [172.30.250.14] port 22.
debug1: Connection established.
debug1: identity file /home/zajcd/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/zajcd/.ssh/id_rsa-cert type -1
debug1: identity file /home/zajcd/.ssh/id_dsa type 2
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: identity file /home/zajcd/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version NetScreen
debug1: no match: NetScreen
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-4ubuntu4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client 3des-cbc hmac-sha1 none
debug1: kex: client->server 3des-cbc hmac-sha1 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Host '172.30.250.14' is known and matches the DSA host key.
debug1: Found key in /home/zajcd/.ssh/known_hosts:24
debug1: ssh_dss_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
debug1: Next authentication method: publickey
debug1: Offering public key: /home/zajcd/.ssh/id_dsa
debug1: Server accepts key: pkalg ssh-dss blen 435
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.utf8
debug1: Sending command: scp -v -f -- ns_sys_config
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
Transferred: sent 2384, received 1464 bytes, in 0.1 seconds
Bytes per second: sent 29048.0, received 17838.2
debug1: Exit status 1

The problem is: Download configuration shall not be made.
In older version hat command works fine.

In older Ubuntu version is different line:
Ubuntu 10.10: debug1: Sending command: scp -v -f -- ns_sys_config
Ubuntu 10.04: debug1: Sending command: scp -v -f ns_sys_config

Revision history for this message
Chuck Short (zulcss) wrote :

What OS is the computer you are trying to copy the file from?

chuck

Changed in openssh (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Damjan Zajc (dzajc21) wrote :

Computer OS whitch do copy is Juniper routers.

Dx3

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for openssh (Ubuntu) because there has been no activity for 60 days.]

Changed in openssh (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Mike Mackintosh (mike-mackintosh) wrote :

I am able to duplicate this issue, with Ubuntu 11.04 and 11.10, it is also affecting Debian Sarge and Squeeze.

debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: scp -v -f -- /ns_sys_config
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

The issue is that the remote devices are not full SSH/SCP capable devices and register the -- after -f as a filename, which does not exist.

Revision history for this message
Mike Mackintosh (mike-mackintosh) wrote :

I downloaded the enw version of SSH:

http://filedump.se.rit.edu/pub/OpenBSD/OpenSSH/portable/openssh-5.9p1.tar.gz

I extracted and searched the source for `-f --`

The -f is a hidden flag to tell the host to expect a file, but I cannot find any documentation as to what the -- is for.

i did a search and replace on -f -- to -f in scp.c in the extracted directory.

I ran make and make install.

From the new SCP binary, the -f -- no longer was issued, only -f.

Issue was resolved for me. I can submit a patch in a moment.

Revision history for this message
Mike Mackintosh (mike-mackintosh) wrote :

Patch submitted to remove -- from scp -v -f -- <file name>

Some systems read the -- as being part of the file name.

Changed in openssh (Debian):
assignee: nobody → Mike Mackintosh (mike-mackintosh)
Changed in openssh (Ubuntu):
assignee: nobody → Mike Mackintosh (mike-mackintosh)
Revision history for this message
Mike Mackintosh (mike-mackintosh) wrote :

To apply patch use the following

In the source code directory:

patch -p1 -i scp.patch

Revision history for this message
Javier Domingo (txomon) wrote :

which is the actual state of the bug? Is there any way to fix it definitely?

Revision history for this message
Mike Mackintosh (mike-mackintosh) wrote :

No. OpenSSH will not apply a fix to this since the above is working as desired. This issue is actually related to netssh code, which Juniper has fixed it in 6.2.0r11.

Changelog shows:

585314— SCP to the firewall failed from an UNIX machine and displayed the error "unknown file '--ns_sys_config."

Revision history for this message
Mike Mackintosh (mike-mackintosh) wrote :

This is an issue with a 3rd party system.

Changed in openssh (Debian):
status: New → Incomplete
status: Incomplete → Invalid
Revision history for this message
Mike Mackintosh (mike-mackintosh) wrote :

Bug with 3rd party system.

Changed in openssh (Ubuntu):
status: Expired → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.