BackupPC-users

Re: [BackupPC-users] Different UID numbers for backuppc on 2 computers

2011-07-11 19:09:00
Subject: Re: [BackupPC-users] Different UID numbers for backuppc on 2 computers
From: Holger Parplies <wbppc AT parplies DOT de>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Tue, 12 Jul 2011 00:34:56 +0200
Hi,

I agree with Les:

Les Mikesell wrote on 2011-07-11 17:18:07 -0500 [Re: [BackupPC-users] Different 
UID numbers for backuppc on 2 computers]:
> On 7/11/2011 4:55 PM, Timothy Murphy wrote:
> > I want to archive backuppc on machine A to machine B.
> > (Both are running CentOS-5.6 .)
> > The problem is that backuppc has different UIDs on the 2 machines:
> > on A it is 101, on B it is 102.
> 
> What do you mean by 'archive'?

If you could describe what you are trying to do (in a way people can
understand), that would help giving meaningful answers.

Do you want to
- create an archive of a host (BackupPC_archive) and store that on an NFS
  export of machine B?
- copy your pool from machine A to machine B?
- use an NFS export of machine B as pool FS for a BackupPC instance running
  on machine A?
- tar together your BackupPC installation on machine A and store the tar
  file on machine B, in case you might decide to use it again?
- do something completely different?

In none of the first four cases is it a problem that the backuppc user has
different UIDs on the two machines, so it must be the last?

> > Now when I NFS mount /archive on machine B on /archive on machine A
> > I am told that /archive belongs to avahi-autoipd ,

Deinstall avahi-autoipd. That's the only thing I believe it is good for,
except for frustrating admins that don't want it installed, yet don't want to
reinvent their packaging system's dependency mechanism.

Seriously, 'mount' gives you informational output about the owner of a
directory?

> It shouldn't matter to the machine exporting the nfs directory whether 
> there is a local user with the same uid or not.  Or are you trying to 
> access the files from both machines?

Well, the only point would be that avahi-autoipd would have access to the
pool, which might not be a good idea.

> > This seems to prevent backuppc from archiving onto /archive .
> 
> All you should need is write access (which might be from having the same 
> owner at the top of the tree).  If you permit root nfs access from the 
> backuppc client you can arrange the proper permissions from there.

I'm guessing (and I *hate* to do that) that you set up permissions
incorrectly. In fact, I don't see why you have a backuppc user on the NFS
server at all.

> > Is there any simple way of changing a UID
> > (together with all the files it owns)?
> 
> You can't do both at once.  You can change the uid in the passwd file 
> but your real problem is that some other package took the uid you want.

Well, you could change the UID of backuppc on the client (assuming the UID the
server uses is free), or you could change UIDs on both client and server to
a common value, that is free on both. Or you could use NIS. Or you could set
up UID mapping for NFS (I've never needed to do that, but I believe it is
possible). Or you could forget about the backuppc user on the NFS server,
though there actually *is* a point in having that user, namely to prevent
something else from allocating the same UID and thus gaining access to the
pool.

Carl Wilhelm Soderstrom wrote on 2011-07-11 17:19:09 -0500 [Re: 
[BackupPC-users] Different UID numbers for backuppc on 2 computers]:
> On 07/11 11:55 , Timothy Murphy wrote:
> > Is there any simple way of changing a UID
> > (together with all the files it owns)?
> 
> vipw then vigr to edit the UIDs in /etc/passwd and /etc/group. You will need
> to do vipw -s and vigr -s to change the /etc/shadow and /etc/gshadow as
> well.

There is no UID information in the shadow files, and unless you're also
worried about the group, you don't need /etc/group either ;-). If you are, you
probably need to change the group of the files, too.

> Then use a command like 'find / -uid 102 -exec chown backuppc: {} \;' to
> change the ownership of all the files owned by UID 102 to whatever UID
> backuppc is. 

Well I hope you don't have many files ... how about either
'chown -R backuppc:backuppc /archive' (assuming that's TopDir) - there are no
files under TopDir *not* belonging to backuppc, or at least there shouldn't be,
and there shouldn't be any files belonging to backuppc elsewhere (check with
find) - or 'find / -uid 102 -print0 | xargs -0 chown backuppc:backuppc'. Just
be careful about what you are doing. Is that the previous UID of avahi-autoipd?
Are there any files owned by that UID that are *not* part of BackupPC? Whenever
something is messed up, and you are trying to clean up the mess, try not to
make the mess bigger in the process ;-).

> > Alternatively, is there a way of telling backuppc to ignore the UIDs?

BackupPC doesn't really care about UIDs at this point. The kernel does. I
don't think you're asking "is there a way to tell the kernel to ignore file
system permissions".

Regards,
Holger

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/