Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 4th March 2013, 22:14
fantalimon fantalimon is offline
Junior Member
Join Date: Feb 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default how use rsync as sudo to copy access_logs from remote server

I'm trying to copy compressed access_log.gz files from /var/log/httpd from a remote server to a local one so that our marketing guy can download them.

There's probably a better way to do this... but this is what I have tried so far and having problem after problem

Have created a webuser account on both servers and added
webuser ALL=(root)NOPASSWD:/usr/bin/rsync at the bottom of /etc/sudoers file

In /home/webuser I placed this file called sync-log

ssh -t webuser@ipaddressofremoteserver rsync -varltpgzhP --rsync-path='sudo rsync' \/var/log/httpd/*.gz webuser@ipaddressofremoteserver:/var/www/html/accesslogs/A

When I run the file as webuser, this is the output:-

webuser@ipaddressofremoteserver's password:
sudo: invalid option -- -
protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(171) [sender=3.0.6]

I have generated and copied the keys from the remote server to the local, ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host. In the known_hosts file of the local server i see the key of the remote server listed, yet, when i run the sync file i'm still asked for the password... not sure why..

any guidance would be greatly appreciated.
Reply With Quote
Sponsored Links


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPConfig fresh instalation - email tab is empty artur_gib Installation/Configuration 14 28th January 2014 20:02
ISPConfig3 mail doesn't work pehden Installation/Configuration 20 9th December 2013 15:05
subdomain and mail relay configuration aranthorn Installation/Configuration 24 3rd September 2007 23:53
Problems with Postfix Mysql Courier PatrickAdrichem Installation/Configuration 3 13th April 2007 16:44
The Perfect Setup Suse 9.3 - Postfix problems new_bee05 HOWTO-Related Questions 20 25th November 2005 03:30

All times are GMT +2. The time now is 13:56.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.