ssh-copy-id in openssh-Portfile-variant-ssh-copy-id.patch

Ryan Schmidt ryandesign at macports.org
Sat Mar 3 22:22:25 PST 2012


On Mar 3, 2012, at 20:06, LLLActive at GMX.Net wrote:

> I just got a "ssh-copy-id"script from a Linux box. It works from the Linux system. I then just used it on the MacBook. It also worked. With both systems I can copy the id_dsa.pub into the target system's authorized_keys.
> 
> Does the patch "openssh-Portfile-variant-ssh-copy-id.patch" generate the /usr/local/bin/ssh-copy-id script? It is is a HTML doc and not a shell script like that on the Linux box. I added a copy at the end.

No. The patch created a portfile variant which, if you select it when you install the port, installs /opt/local/bin/ssh-copy-id. That variant has now been deleted, and the port will now always install that script.

MacPorts does not install files in /usr/local, and it is not supported to have files in /usr/local while using MacPorts because they can interfere with MacPorts. Please remove whatever you have in /usr/local.

/usr/local/bin/ssh-copy-id is the version of the script (or rather, the HTML 404 error that is not a script) that you installed there earlier, using the commands you showed us in your first email.


> I found another at /opt/local/bin/ssh-copy-id. It is the same as the Linux version.

That is the file the MacPorts openssh port installed.


> Removing the "/usr/bin/ssh-copy-id" defaults "which ssh-copy-id" to "/usr/local/bin/ssh-copy-id".

Do not remove files in /usr/bin; they were provided by Apple and may be essential to the proper functioning of OS X.


> The "/opt/local/bin/ssh-copy-id" is not used.

When MacPorts was first installed, it should have modified your ~/.profile or ~/.bash_profile and added a line that modifies your PATH environment variable so that /opt/local/bin appears first in it, which would mean that "ssh-copy-id" would be /opt/local/bin/ssh-copy-id. If that did not happen, or if you or some other process undid it, you can edit your profile and repair it. Further explanations about how MacPorts sets up your PATH and instructions for doing it manually are here:

http://guide.macports.org/chunked/installing.shell.html


> Doing "/opt/local/bin/ssh-copy-id -i /Users/lsr/.ssh/id_dsa.pub user at server.com" works as the Linux version.

Great, then the script MacPorts installed is working.


> The script I got from the Linux box I put it in /usr/bin/ssh-copy-id on the MacBookPro. "which ssh-copy-id" then defaults to "/usr/bin/ssh-copy-id".

It would be best to undo this and restore the version of the script Apple had there.


> It does not allow me to log in with the key yet; I still have to give a password. Can not figure out why. The entry in the "~/.ssh/authorized_keys" is there, but may be erroneous. I'm not sure how to verify that the entry is correct.
> 
> Any ideas welcome.

I don't know this script so I can't provide advice here.




More information about the macports-users mailing list