Gentoo Archives: gentoo-user

From: Hans-Werner Hilse <hilse@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] changing user id
Date: Fri, 21 Jul 2006 10:47:27
Message-Id: 20060721123611.7788c3b4.hilse@web.de
In Reply to: [gentoo-user] changing user id by Arnau Bria
1 Hi,
2
3 On Fri, 21 Jul 2006 12:02:49 +0200 Arnau Bria <arnau@×××××××××.net>
4 wrote:
5
6 > I'd like to change cyrus id from currently to 120.
7
8 Why's that? You will at least bork the existing files to a degree that
9 they can't be automatically uninstalled by emerge anymore.
10
11 > I tried usermod, but cyrus files didn't change its owner.
12
13 No, usermod & Co only modify the authentication db, i.e. /etc/passwd.
14
15 > could someone explain which is the way of changing user id and that
16 > user doesn't lose its files?
17
18 A subsequent run of
19
20 find / -user <olduid> -exec chown cyrus '{}' \;
21
22 (as root, of course) should suffice. I don't see a way to do this
23 atomically with the UID change.
24
25 Note that your backups will probably still carry the old UID, keep that
26 in mind for the case you need to restore them.
27
28 -hwh
29 --
30 gentoo-user@g.o mailing list