ssh-copy-id assumes $HOME
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
portable OpenSSH |
Unknown
|
Unknown
|
|||
openssh (Debian) |
Fix Released
|
Unknown
|
|||
openssh (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
ssh-copy-id assumes that the default working directory on the remote machine will be $HOME. In some cases the login scripts on the remote machine change the working directory to something other than $HOME. The patch below should solve this (not widely tested):
--- ssh-copy-id.orig 2010-12-07 09:36:20.297263103 -0800
+++ ssh-copy-id 2010-12-07 09:37:15.226054626 -0800
@@ -38,7 +38,7 @@
exit 1
fi
-{ eval "$GET_ID" ; } | ssh ${1%:} "umask 077; test -d .ssh || mkdir .ssh ; cat >> .ssh/authorized
+{ eval "$GET_ID" ; } | ssh ${1%:} "umask 077; cd $HOME; test -d .ssh || mkdir .ssh ; cat >> .ssh/authorized
cat <<EOF
Now try logging into the machine, with "ssh '${1%:}'", and check in:
Changed in openssh (Debian): | |
status: | Unknown → New |
Changed in openssh (Ubuntu): | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in openssh (Debian): | |
status: | New → Fix Released |
Thanks for your report. This was actually fixed upstream a little while back, in OpenSSH 5.6p1:
20100618 ssh-copy- id] Update key file explicitly under ~
- (djm) [contrib/
rather than assuming that $CWD == $HOME. bz#1500, patch from
timothy AT gelter.com
The packages in Natty contain this fix.