On 12/30/2010 12:59 AM, kashani wrote: > On 12/29/2010 1:36 PM, Tanstaafl wrote: >> On 2010-12-29 3:50 PM, kashani wrote: >>> On 12/29/2010 9:14 AM, Tanstaafl wrote: >>>> I'm updating an old system I inherited that has postfixadmin 2.1 >>>> installed, and I have a question about the vacation user entry in >>>> /etc/passwd... >> >> <snip> >> >>> I would consider a plan to upgrade to 2.3.2, >> >> I guess I could have been clearer - I said I was updating the system, >> and updating pfadmin to 2.3.2 is what I'm doing now... and I want to >> configure everything *correctly*. Right now, vacation has a shell, and >> it shouldn't - I just want to know if simply editing /etc/passwd is the >> correct way to fix it... >> >>> but it would be far simpler to build a new system and switch over to >>> it than upgrade in place. And safer. >> >> I already have the new pfadmin up and running, and I'll be switching >> over this weekend... >> >> Any idea about my other question: >> >>>> Also, out of curiosity - can /etc/passwd file contain comments? >> >> Thanks... >> > > Sure you can edit it directly though you'll break anyone currently using > vacation as soon as you do. Make sure you fix /etc/shadow and /etc/group > too. Or use usermod which would be the proper way to make the change. > > /etc/passwd shouldn't have stand alone comments which might cause weird > problems with pwconv, grpconv, etc. Use the comment field of the user. > > kashani > See "$ man -S5 passwd" for the format of /etc/passwd. Or in short:
Each line of the file describes a single user, and has the following format: account:password:UID:GID:GECOS:directory:shell So there is no comment allowed. But you can place this stuff in GECOS if you like and need it. Will be visible to users though. About editing /etc/passwd directly: don't! It can mess up your system, so that noone can login anymore. The recomended way is "$ usermod", the "direct" way is "$ vipw". It is a wrapper around "vi" that does simple sytax checks, so you don't break things. I use it if I have to edit /etc/passwd. There is also "vigr" :) "$ vipw -s" and "$vigr -s" lets you edit the shadow files. Bye, Daniel -- PGP key @ http://pgpkeys.pca.dfn.de/pks/lookup?search=0xBB9D4887&op=get # gpg --recv-keys --keyserver hkp://subkeys.pgp.net 0xBB9D4887
signature.asc
Description: OpenPGP digital signature