ssh-copy-id cannot handle spaces in usernames

Bug #1074798 reported by Ken Sharp
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
portable OpenSSH
Fix Released
Low
openssh (Debian)
Fix Released
Unknown
openssh (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

If a username has a space in it, ssh-copy-id cannot handle it, unless it's in a non-obvious way. ssh itself has no problem with spaces.

$ ssh-copy-id "User name"@server
ssh: Could not resolve hostname User: Name or service not known
$ ssh-copy-id "User\ name"@server
ssh: Could not resolve hostname User\\: Name or service not known
$ ssh-copy-id User\ name@server
ssh: Could not resolve hostname User: Name or service not known

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: openssh-client 1:5.9p1-5ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-32.51-generic 3.2.30
Uname: Linux 3.2.0-32-generic x86_64
NonfreeKernelModules: fglrx wl
ApportVersion: 2.0.1-0ubuntu14
Architecture: amd64
Date: Sun Nov 4 02:34:02 2012
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
ProcEnviron:
 LANGUAGE=en_GB:en
 TERM=xterm
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
RelatedPackageVersions:
 ssh-askpass N/A
 libpam-ssh N/A
 keychain N/A
 ssh-askpass-gnome 1:5.9p1-5ubuntu1
SSHClientVersion: OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
SourcePackage: openssh
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Ken Sharp (kennybobs) wrote :
Revision history for this message
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.

Marking this as Low priority in Ubuntu since spaces in Unix usernames are so incredibly rare that I assume that this bug only affects a tiny proportion of Ubuntu users.

It looks like there is some quoting missing from the ssh-copy-id script, and that bug comes all the way from upstream via Debian.

The best place to fix this bug would be in the upstream project at http://www.openssh.com - then Debian and Ubuntu as well as non-Linux ports would all be fixed in one go.

Do you think you could follow this up with upstream directly, please?

Changed in openssh (Ubuntu):
status: New → Triaged
importance: Undecided → Critical
importance: Critical → Low
tags: added: needs-upstream-report
Revision history for this message
In , Ken Sharp (kennybobs) wrote :

If a username has a space in it, ssh-copy-id cannot handle it, unless it's in a non-obvious way. ssh itself has no problem with spaces.

$ ssh-copy-id "User name"@server
ssh: Could not resolve hostname User: Name or service not known
$ ssh-copy-id "User\ name"@server
ssh: Could not resolve hostname User\\: Name or service not known
$ ssh-copy-id User\ name@server
ssh: Could not resolve hostname User: Name or service not known

From https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1074798/comments/2
"It looks like there is some quoting missing from the ssh-copy-id script"

Possibly related:
https://bugzilla.mindrot.org/show_bug.cgi?id=1164
https://bugzilla.mindrot.org/show_bug.cgi?id=1980

Apologies if this is logged against the incorrect component. ssh-copy-id seems to call ssh-add but it's more than likely a problem with the script rather than ssh-add.

Changed in openssh:
importance: Unknown → Low
status: Unknown → Confirmed
Changed in openssh (Debian):
status: Unknown → New
Revision history for this message
In , Damien Miller (djm) wrote :

retarget to openssh-6.3

Revision history for this message
In , Damien Miller (djm) wrote :

Updated ssh-copy-id script committed for openssh-6.2

Revision history for this message
In , Damien Miller (djm) wrote :

mark bugs closed by openssh-6.2 release as CLOSED

Changed in openssh:
status: Confirmed → Fix Released
Changed in openssh (Debian):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package openssh - 1:6.2p1-2

---------------
openssh (1:6.2p1-2) unstable; urgency=low

  * Fix build failure on Ubuntu:
    - Include openbsd-compat/sys-queue.h from consolekit.c.
    - Fix consolekit mismerges in monitor.c and monitor_wrap.c.

 -- Colin Watson <email address hidden> Thu, 09 May 2013 09:45:57 +0100

Changed in openssh (Ubuntu):
status: Triaged → Fix Released
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.