LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-14-2011, 09:57 PM   #1
sir-lancealot
Member
 
Registered: Aug 2007
Posts: 346

Rep: Reputation: 31
rsync as root + perl question


Not a programmer but thought this was more server than programming. But I am backing up several servers, or rather starting to setup a new backup due to the current one not working correctly.

I am looking to see how/why this is working, but the current script is run nightly as root, there is the following;

#!/usr/bin/perl

system("rsync -rlpogt --delete server::folder /folder/ > /root/rlog.txt 2>&1");

now this run's nightly, and works as root. Yet, if I say from server 1-> ssh server2 <enter> I am prompted for a root password.

I would love to re-write my script using bash (as I don't know perl), but my question is what or where is there some hidden security bypass to allow rsync to work, yet ssh doesn't (as I would always setup an ssh key between) but don't want to use root, but they are obviously rsyncing over successfully with no password!

##### Update:

As I continued reading, it seems to be that they are running the rsync deamon which looks like it listens and allows the connection, etc. so it seems to be that's the right path. I do need to look at how to config, allow, etc. but at least that looks like it is. Feel free to confirm, send .02 on setting it up, etc. but I do think that's it.

Thanks

Last edited by sir-lancealot; 02-14-2011 at 10:01 PM.
 
Old 02-14-2011, 10:18 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
The two colons in the rsync command mean they're talking to an rsync daemon.
 
Old 02-14-2011, 10:22 PM   #3
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
As far as the bash script, you could add your user to the sudoers file, and just use sudo with the bash script.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync with permissions, but not as root nifflerX Linux - General 5 09-29-2011 12:14 AM
how to use rsync as root hueofwind Linux - General 3 03-29-2006 06:16 PM
running rsync as root msound Linux - Security 4 11-09-2005 11:16 AM
Hiding code in PERL, perl gui question randomx Programming 1 06-26-2004 04:22 PM
PERL question about getting input of current root window image joesbox Programming 3 01-02-2004 03:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration