Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-28-2009, 11:53 AM   #1
Registered: Jul 2007
Location: NY, NY
Distribution: RHEL, CentOS, FC, Ubuntu
Posts: 127

Rep: Reputation: 26
Remote rsync/rsnapshot backups as a limited privelege user

Hello everyone. Here's what I'm trying to do -

I run rsnapshot to backup several linux machines to different servers. Usually I just fill the authorized_keys file in /root/.ssh on my clients with the file of root on my server and have it ssh in with full privs and do the backup. On the new setup I'm creating right now, I'm trying to be more security conscious and try something new.

On the client (FWIW, this specific client is OS X), I have a user that we'll call "backup" and this user has sudo priveleges. I've edited the sudoers file so backup can only use sudo to execute rsync, and to do that without needing a password. I also put an alias in backup's .bash_profile so that rsync is actually "sudo rsync". I've tested this and it works fine. When I manually login as backup, I can execute rsync as root, sans password, without actually typing the word "sudo".

In rsnapshot.conf on the server (FC 9), I've edited it so the program ssh's in as "backup@osxclient" to do the backup, instead of "root@osxclient". However I'm still getting "permission denied" errors during the backup. I'm not quite sure how to figure this out from here. It seems that when rsnapshot logs in as "backup", it's not getting the same environment as when I manually log in as "backup". Am I on the right track? And how can I change that?

- Van
Old 07-30-2009, 11:27 AM   #2
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,293

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335

I don't know much about OS X, but I think you need to put the alias in .bashrc and not in .bash_profile. The latter file is only sourced on login shells, so if you do for example "ssh backup@osxclient somecommand", only .bashrc is read.

It should also be in the beginning of .bashrc. In the beginning of mine, there is:

# If not running interactively, don't do anything
[ -z "$PS1" ] && return


backup, rsnapshot, rsync

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 - Backups pkraus109 Linux - Server 2 05-21-2009 01:36 PM
LXer: rsnapshot - Local/Remote Filesystem backups utility in openSUSE LXer Syndicated Linux News 0 10-06-2008 08:41 PM
Backups with rsnapshot jeremy LQ Articles Discussion 0 07-30-2007 01:58 PM
Rsync backups gabsik Linux - General 3 11-24-2006 08:14 PM
rsync and rsnapshot madman100 Linux - Newbie 4 10-10-2006 10:33 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:28 AM.

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