0

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" [email protected]:data/

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/id_dsa.pub [email protected]

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.

Scott

1 Answer 1

0

Yes, you need to add your public key (.ssh/id_dsa.pub) 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/id_dsa.pub | ssh [email protected] "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.

3
  • 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
    – Scott
    Commented Nov 19, 2010 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 [email protected], 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/id_dsa.pub into ~/.ssh/authorized_keys on the server (just make sure not to introduce any extra linebreaks). Commented Mar 10, 2011 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
    – Scott
    Commented Mar 21, 2011 at 12:37

You must log in to answer this question.

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