rsync + ssh almost got it! But having a wierd problem :(
Everything works fine and my null passphrase key works if I just use ssh... ie
$ ssh -i ~/.ssh/id_dsa_nullkey user@host ssh connects right up without a password or anything just how I want it to. But, when I try to connect with rsync its a different story. I'm using the following command... $ /usr/bin/rsync -navz ~/backup/ -e "ssh -i ~/.ssh/id_dsa_nullkey" user@host:backup/ This spits out the following error Warning: Identity file ~/.ssh/id_dsa_nullkey not accessible: No such file or directory. I'm then asked for my password as if I was logging in without the id_dsa_nullkey identity. I have the id_dsa_nullkey.pub in the ~/.ssh/ directory with the permission set to 600 on both the local and remote machines. In case it matters I created the key using the following command. $ ssh-keygen -t dsa -f id_dsa_nullkey I'm kinda lost at this point. It doesn't make sense to me how ssh can work just fine, but rsync won't. Any suggestions? |
What happens when you do this?
Code:
$ /usr/bin/rsync -navz -e ssh ~/backup host:backup/ |
Is there a rsync user account?
|
$ /usr/bin/rsync -navz -e ssh ~/backup host:backup/
Password: building file list ... done backup/ backup/test sent 101 bytes received 24 bytes 27.78 bytes/sec total size is 20 speedup is 0.16 worked... but I think that would be syncing the files in the opposite order that I'm trying to do. Maybe I'm confused. I'm trying to sync the files off my computer to a remote server (ie. changed files will be uploaded from my machine to the remote machine). I'm running the rsync command from my computer. Would this be the correct usage? And no, there isn't an rsync user on the machine. I only have a user account on the box. |
Code:
$ /usr/bin/rsync -navz -e ssh ~/backup host:backup/ |
cool, thats what I want. But its not using the key ssh key that I created that doesn't use a password.
Ultimately what I'm trying to do is connect to the remote backup host with two different keys. One key I want to be asked for a password and will be the way that I normally connect to the remote host. The other key I want to use only for backup with rsync and thus shouldn't have a password. I'll be restricting the access of the key that doesn't have a password with a script called validate-rsync by placing it in the ~/.ssh/id_dsa_nullkey file. Code:
command="~/validate-rsync" ssh-dss AAAAB3Nza Here's the code in validate-rsync script Code:
#!/bin/sh The process I'm trying to duplicate is documented in this article: <http://troy.jdmz.net/rsync/index.html> I still can't figure out why ssh will accept the identity file normally, but when ssh is used in conjunction with rsync it won't. |
Code:
$ /usr/bin/rsync -navz -e "ssh -i ~/.ssh/id_dsa_nullkey" ~/backup host:backup/ Warning: Identity file ~/.ssh/id_dsa_dreamhost_backup not accessible: No such file or directory. and then asks for a password. I can't get it to recognize the identity file. |
All times are GMT -5. The time now is 12:26 PM. |