Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'll start by saying I'm very new to MAC but comfortable in using the command line thanks to using a linux a lot.

I currently have rsync setup to run between a MAC OSX 10.5.8 server to a Linux Centos 5.5 Server. This is the command I'm running on the MAC server:

rsync -avhe ssh "/Path/To/Data" username@

As it does it prompts for a password but I need it to save the password. After looking around I need to use:

ssh-keygen -t dsa

save the passkey and then move it over to the Linux server using:

ssh-copy-id -i .ssh/ username@

But ssh-copy-id doesnt seem to exist on the MAC server. How do I copy this key over? I've tried searching for the answer myself but the help seems to be all over the place for this..

Any help is greatly appreciated.


share|improve this question
up vote 0 down vote accepted

Yes, you need to add your public key (.ssh/ to the file .ssh/authorized_keys at the server. ssh-copy-id is just a simple shell script that does this for you. What it does is basically this:

cat ~/.ssh/ | ssh username@ "umask 077; test -d .ssh || mkdir .ssh; cat >> .ssh/authorized_keys"

It pipes the key over ssh (you have to specify the password this time, but hopefully it is the last time) and creates the directory ".ssh" at the server if it doesn't exist.

share|improve this answer
Sorry the command you have given doesnt seem to work. Had to add a closing " to the end to get it to input and was asked for the password which I entered but when I run rsync again I'm still asked for the password – Brady Nov 19 '10 at 12:24
Sorry for the missing closing quote. But otherwise the command should be complete. You've probably figured it out by now, but you should try logging in using ssh username@, then cd .ssh and cat authorized_keys to see if the public key actually has been copied over. If not, you can always copy-paste the contents of ~/.ssh/ into ~/.ssh/authorized_keys on the server (just make sure not to introduce any extra linebreaks). – danmichaelo Mar 10 '11 at 15:59
I managed to manually copy the key across using file manager tools as I couldnt get it moved over using ssh. But without knowing where it needed to go I wouldnt have been able to solve this. thanks – Brady Mar 21 '11 at 12:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .