Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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@192.168.1.11: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 username@192.168.1.11

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

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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 username@192.168.1.11 "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@192.168.1.11, 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). –  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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.