From owner-freebsd-questions@FreeBSD.ORG Fri Jan 25 07:03:16 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8FB207E6 for ; Fri, 25 Jan 2013 07:03:16 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 3EDB4186 for ; Fri, 25 Jan 2013 07:03:16 +0000 (UTC) Received: from r56.edvax.de (port-92-195-8-191.dynamic.qsc.de [92.195.8.191]) by mx02.qsc.de (Postfix) with ESMTP id 29A03277C6; Fri, 25 Jan 2013 08:03:08 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id r0P73BPU002011; Fri, 25 Jan 2013 08:03:11 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Fri, 25 Jan 2013 08:03:11 +0100 From: Polytropon To: Ralf Mardorf Subject: Re: Sharing a mail folder between Linux and FreeBSD Message-Id: <20130125080311.d794da70.freebsd@edvax.de> In-Reply-To: <1359076287.2155.18.camel@precise> References: <1358988080.4855.5.camel@precise> <5101B141.2090909@gmail.com> <1359076287.2155.18.camel@precise> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2013 07:03:16 -0000 On Fri, 25 Jan 2013 02:11:27 +0100, Ralf Mardorf wrote: > Hi all, hi Joshua, > > On Thu, 2013-01-24 at 16:10 -0600, Joshua Isom wrote: > > find / -uid 1001 -exec chown 1000 '{}' \; > > find / -gid 1001 -exec chown :1000 '{}' \; > > I made one mistake, when I run "find / -gid 1001 -exec chown :1000 '{}' > \;" for the fist time, I did it without the ":". Later I run it without > the typo. > > There's a serious problem now, rocketmouse still is 1001. You should have been reading my advice about changing the UID:GID in detail. :-) What you seem to be missing is a rebuild of the database that reflects the content of the password files (where you have properly made the changes 1001 -> 1000 in /etc/passwd, /etc/master.passwd and /etc/group). The command you're searching for is pwd_mkdb. > .login_conf was '1000 1001', after I "chown 1001" it, to start X as > user, it became 'rocketmouse 1001', the user rocketmouse still can't run > a X session anymore. UIDs and GIDs should match here. All files belonging to rocketmouse should be 1000:1000 _and_ the name "rocketmouse" should be associated to those numerical values (see files mentioned above). > After rebooting this is the output I get: Rebooting is _not_ the way to make a probem magically go away. :-) > # id rocketmouse > uid=1001(rocketmouse) gid=1001 groups=1001,0(wheel) This means the change of 1001 -> 1000 has not been fully done, in _all_ involved files. > # ls -hAl /home/ | grep rocketmouse > drwxr-xr-x 28 1000 rocketmouse 1.5k Jan 24 18:14 rocketmouse Here, on "file system level", the UID has been changed to 1000 properly, but this UID still doesn't have a matching "name". > # grep 100 /etc/group > rocketmouse:*:1000: > musicpd:*:1002: > > # grep 100 /etc/passwd > rocketmouse:*:1000:1000:Ralf:/home/rocketmouse:/bin/sh > musicpd:*:1002:1002:Music Player Daemon:/home/musicpd:/usr/sbin/nologin > > # grep 100 /etc/master.passwd > rocketmouse:$1$3mMkzcfl > $VuryrlzFZ92LmaC6cUOa/.:1000:1000::0:0:Ralf:/home/rocketmouse:/bin/sh > musicpd:*LOCKED**:1002:1002:daemon:0:0:Music Player > Daemon:/home/musicpd:/usr/sbin/nologin All correct. But pwd.db and spwd.db (the password databases with encrypted content) don't reflect those informations! > I repeated both find-chown several times and rebooted, nothing changed, > it doesn't list any files anymore. No, repeating what has already been done properly and then rebooting is, as I said, not a way to make problems magically go away. I don't know a setting where this should work... :-) So here's what you need to do: Read "man pwd_mkdb" and rebuild the databases. If you would have used the "vipw" command to make the change to the passwd (plain text) files, it would have called pwd_mkdb after the change. But don't worry: Knowing those "low level hacks" can be helpful in some worst-case scenario. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...