[Bug 1500] New: enhance ssh-copy-id to work when login dir on server is not /home/user
bugzilla-daemon at bugzilla.mindrot.org
bugzilla-daemon at bugzilla.mindrot.org
Wed Aug 6 03:04:58 EST 2008
https://bugzilla.mindrot.org/show_bug.cgi?id=1500
Summary: enhance ssh-copy-id to work when login dir on server
is not /home/user
Classification: Unclassified
Product: Portable OpenSSH
Version: 5.0p1
Platform: All
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P2
Component: Miscellaneous
AssignedTo: unassigned-bugs at mindrot.org
ReportedBy: timothy at gelter.com
Created an attachment (id=1556)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=1556)
patchfile which fixes the assumption that after ssh'ing into a machine,
the cwd is ~/
ssh-copy-id currently assums that when copying over the key, it is
sufficient to check for a .ssh dir at the current location (normally
the user's home directory) and then proceed to copy the public key to
the .ssh/authorized_keys file, creating the .ssh directory if needed.
Under some circumstances, the current working directory of the shell
after logging into the server over ssh will *NOT* be the user's home
directory, so it can't be assumed that we're always operating in the
user's home directory.
As an example, let's say that there is a server that I log in to only
to work on documentation. Since every time I log in to that machine,
I'll be working in /home/me/documentation, I decide to stick a new line
in my ~/.bashrc that simply does a "cd ~/documentation" after
initializing aliases and everything else. In this case, when the
ssh-copy-id script is run, a new directory ~/documentation/.ssh is
created, and my public key is copied to a new file called
~/documentation/.ssh/authorized_keys. Now, as expected, when I try to
ssh into the machine, key-based authentication is never attempted and
I'm forced to manually move my key over from
~/documentation/.ssh/authorized_keys to ~/.ssh/authorized_keys which
defeats the purpose of using ssh-copy-id.
Attached is a patch which fixes this issue.
Thanks!
--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
More information about the openssh-bugs
mailing list