Gentoo Archives: gentoo-user

From: Daniel Troeder <daniel@×××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] postfixadmin vacation user uid/home in /etc/passwd
Date: Thu, 30 Dec 2010 08:34:55
Message-Id: 4D1C51E8.2080805@admin-box.com
In Reply to: Re: [gentoo-user] postfixadmin vacation user uid/home in /etc/passwd by kashani
1 On 12/30/2010 12:59 AM, kashani wrote:
2 > On 12/29/2010 1:36 PM, Tanstaafl wrote:
3 >> On 2010-12-29 3:50 PM, kashani wrote:
4 >>> On 12/29/2010 9:14 AM, Tanstaafl wrote:
5 >>>> I'm updating an old system I inherited that has postfixadmin 2.1
6 >>>> installed, and I have a question about the vacation user entry in
7 >>>> /etc/passwd...
8 >>
9 >> <snip>
10 >>
11 >>> I would consider a plan to upgrade to 2.3.2,
12 >>
13 >> I guess I could have been clearer - I said I was updating the system,
14 >> and updating pfadmin to 2.3.2 is what I'm doing now... and I want to
15 >> configure everything *correctly*. Right now, vacation has a shell, and
16 >> it shouldn't - I just want to know if simply editing /etc/passwd is the
17 >> correct way to fix it...
18 >>
19 >>> but it would be far simpler to build a new system and switch over to
20 >>> it than upgrade in place. And safer.
21 >>
22 >> I already have the new pfadmin up and running, and I'll be switching
23 >> over this weekend...
24 >>
25 >> Any idea about my other question:
26 >>
27 >>>> Also, out of curiosity - can /etc/passwd file contain comments?
28 >>
29 >> Thanks...
30 >>
31 >
32 > Sure you can edit it directly though you'll break anyone currently using
33 > vacation as soon as you do. Make sure you fix /etc/shadow and /etc/group
34 > too. Or use usermod which would be the proper way to make the change.
35 >
36 > /etc/passwd shouldn't have stand alone comments which might cause weird
37 > problems with pwconv, grpconv, etc. Use the comment field of the user.
38 >
39 > kashani
40 >
41 See "$ man -S5 passwd" for the format of /etc/passwd. Or in short:
42
43 Each line of the file describes a single user, and has the following format:
44 account:password:UID:GID:GECOS:directory:shell
45
46 So there is no comment allowed. But you can place this stuff in GECOS if
47 you like and need it. Will be visible to users though.
48
49 About editing /etc/passwd directly: don't! It can mess up your system,
50 so that noone can login anymore. The recomended way is "$ usermod", the
51 "direct" way is "$ vipw". It is a wrapper around "vi" that does simple
52 sytax checks, so you don't break things. I use it if I have to edit
53 /etc/passwd. There is also "vigr" :) "$ vipw -s" and "$vigr -s" lets you
54 edit the shadow files.
55
56 Bye,
57 Daniel
58
59
60 --
61 PGP key @ http://pgpkeys.pca.dfn.de/pks/lookup?search=0xBB9D4887&op=get
62 # gpg --recv-keys --keyserver hkp://subkeys.pgp.net 0xBB9D4887

Attachments

File name MIME type
signature.asc application/pgp-signature