Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Technical

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 16th November 2009, 16:58
jnsc jnsc is offline
rotaredoM
 
Join Date: Mar 2006
Location: Lausanne, Switzerland
Posts: 531
Thanks: 11
Thanked 175 Times in 79 Posts
Default Copiying /etc/shadow with sudo and rsync

Hi,

I have a little problem, and at the first look it might look easy, but it's not, or at least I did not find an easy solution. I have 2 server, which must rsync some files, including /etc/passwd and /etc/shadow. Everything was working fine until we decided to forbid rootlogin on the server, and use sudo for the sync. My problem is that /etc/shadow has a file permission of 400, so the non privilegd user can not read it, so I can use a command like this
Code:
rsync  --rsync-path='sudo rsync' --rsh='/usr/bin/ssh -x' --archive /etc/shadow user@server2:/etc/shadow
because user is not authorised to read /etc/shadow, so I tried this
Code:
rsync  --rsync-path='sudo rsync' --rsh='/usr/bin/ssh -x' --archive user@localhost:/etc/shadow user@server2:/etc/shadow
so that it uses sudo twice, but I get this error
Code:
rsync: mkstemp "/home/user/user@server2:/etc/.shadow.wBWPkX" failed: No such file or directory (2)
rsync error: some files could not be transferred (code 23) at main.c(1146)
So does somebody know an easy and Secure solution?

Thanks
Reply With Quote
Sponsored Links
  #2  
Old 17th November 2009, 18:38
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,749 Times in 2,579 Posts
Default

No, unfortunately not.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 17th November 2009, 20:42
jnsc jnsc is offline
rotaredoM
 
Join Date: Mar 2006
Location: Lausanne, Switzerland
Posts: 531
Thanks: 11
Thanked 175 Times in 79 Posts
Default

Thanks falko for your reply, as it was not an easy question, I was not expecting a magical solution, but I tough that maybe somebody already had this problem. Maybe I will try to ask on a sudo mailing list.
Reply With Quote
Reply

Bookmarks

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
a backup server by RSYNC + SSH in a chrooted environment paguira Server Operation 3 23rd August 2008 17:44


All times are GMT +2. The time now is 06:57.


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