[Bug 2349] New: ssh-copy-id transfer keys into current directory instead of home folder

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Wed Feb 4 14:26:25 AEDT 2015


https://bugzilla.mindrot.org/show_bug.cgi?id=2349

            Bug ID: 2349
           Summary: ssh-copy-id transfer keys into current directory
                    instead of home folder
           Product: Portable OpenSSH
           Version: 6.7p1
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: ssh-copy-id
          Assignee: unassigned-bugs at mindrot.org
          Reporter: gabrielmagno1 at gmail.com

Created attachment 2543
  --> https://bugzilla.mindrot.org/attachment.cgi?id=2543&action=edit
Possible patch to copy key into home folder (instead of current
directory)

On the server, I configure my user to change the current directory upon
login. For example, I add the command "cd /path/to/project" in my
~/.bashrc.

Then, on the client, if I try to "ssh-copy-id user at myserver", it will
run smoothly (identifies that it need to add new key, ask for password,
says it added the key and ask to try to login), but when I try to
login, it will keep asking for password. If I try to execute
ssh-copy-id again it keeps identifying that the key need to be added
(as if it was not added before). I verified permissions, and they are
correct.

I found out that the directory "/path/to/project/.ssh" was created, as
was an "authorized_keys" file inside it, containing multiple repeated
lines of my public key (one for each of the attempts of issuing
ssh-copy-id).

By looking into ssh-copy-id's source script, I could see that it
assumes it is already in the home folder, and appends the new keys into
".ssh/authorized_keys". Shouldn't it be appended to
"~/.ssh/authorized_keys"?

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list