Sudoers and rsync over ssh help
Hi guys. So here's my situation. I have a server I'm about to wipe and rebuild. I have a backup at a remote location but I want the files locally so I can fool around with them and pick and choose what i want on the server. So I want to rsync certain directories over ssh.
Here's what I'm doing. My rsync command: rsync -avz -e "ssh -p 22" mjboa@site:/etc/ /home/mike/Documents/Projects/site_backup_12_3_09/etc/ --rsync-path="sudo rsync" This worked on a different directory so I know I have the basics down. The confusing part is that I need root access on the remote machine to read /etc but I don't want to PermitRootLogin on sshd. So I read somewhere that I can set it so that I don't need to enter a password for sudo with just rsync and I can set the command rsync runs on the remote machine. Makes perfect sense. So I have my sudoers on the remote machine: mjboa ALL=PASSWD: ALL, NOPASSWD:/usr/bin/rsync I see nothing wrong with this, even through the screwed syntax of sudoers, and I've had trouble with sudoers before. What I get out of this is when i log in as mjboa on my server, I don't get prompted for a password at all, for any command. And when I run the rsync command, it actually prompts me for a password! And it displays it in plain text and does nothing when I enter it. What the hell is going on? Someone has to have done this successfully before. Thanks. |
Save yourself the headache and just rsync the other way.
ssh mjboa@site sudo rsync -avz /etc/ localusername@localworkstation:/home/mike/Documents/Projects/site_backup_12_3_09/etc/ |
Quote:
I know that I can set --rsync-path='sudo rsync' ... but I have to disable requiretty, and that's pretty insecure if I understand correctly... |
All times are GMT -5. The time now is 11:20 PM. |