bugzilla-daemon at mindrot.org
2015-Feb-04 03:26 UTC
[Bug 2349] New: ssh-copy-id transfer keys into current directory instead of home folder
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.
bugzilla-daemon at bugzilla.mindrot.org
2015-Nov-25 23:01 UTC
[Bug 2349] ssh-copy-id transfer keys into current directory instead of home folder
https://bugzilla.mindrot.org/show_bug.cgi?id=2349 Philip Hands <phil at hands.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil at hands.com Status|NEW |ASSIGNED --- Comment #1 from Philip Hands <phil at hands.com> --- That's odd, since I just tried to reproduce the problem, and with a cd in my ~/.bashrc, interactive logins end up in another directory, but commands seem to be run in the homedir. Could you mention which versions of software you're getting this effect with? Anyway, I don't suppose adding a 'cd' command at the start would do any harm, so maybe I'll do that anyway. -- You are receiving this mail because: You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2015-Nov-25 23:03 UTC
[Bug 2349] ssh-copy-id transfer keys into current directory instead of home folder
https://bugzilla.mindrot.org/show_bug.cgi?id=2349 Philip Hands <phil at hands.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned-bugs at mindrot.org |phil at hands.com -- You are receiving this mail because: You are watching the assignee of the bug.
Reasonably Related Threads
- [Bug 3201] New: provide an option to use sftp instead of ssh 'exec sh -c …' for installing ssh-keys via ssh-copy-id
- ssh-copy-id no newline bug
- [Bug 1500] New: enhance ssh-copy-id to work when login dir on server is not /home/user
- [Bug 2128] New: ssh-copy-id doesn't check if a public key already exists in a remote servers ~/.ssh/authorized_keys file
- ssh-copy-id no newline bug