Cannot Add User

2004-02-04 Thread Vince Sabio
I just installed a v5.1 single-boot system from CD. So far, the only 
changes I've made from the initial installation were to configure 
sshd, set the system security level to moderate (from high), and 
set the system clock; other than that, it's a clean installation.

I'm now trying to install Postfix, and the problem I'm running into 
is that I cannot create new user accounts. I created several user 
accounts during installation, and they seem to be fine. But when I 
[manually] create entries in /etc/passwd, master.passwd, and group, 
the entries are 'ignored' -- e.g., a chown [newuser] [filename] 
command fails, attempts to su from root into the user account fail, 
etc. When I try to create the user via adduser (using the standard 
defaults), the account creation step fails with the following error:

pw: user '[newuser]' disappeared during update

Again, attempts to 'access' the user (i.e., chmod, etc.) will fail. 
Interestingly, though, if I try to re-create the user, adduser tells 
me that the user already exists -- and a check of the relevant files 
confirms that the entries are there.

I've looked around for a solution to this problem, but haven't found 
one, so here I am.

FYI, the system security level was set to high during installation, 
and was then reset to moderate after installation, as this system 
is intended to be used as a server (and high was too restrictive; I 
couldn't even [find a way to] set the system time correctly).

Appreciate the assistance
--
__
Vince Sabio  [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Cannot Add User

2004-02-04 Thread Lowell Gilbert
Vince Sabio [EMAIL PROTECTED] writes:

 I just installed a v5.1 single-boot system from CD. So far, the only
 changes I've made from the initial installation were to configure
 sshd, set the system security level to moderate (from high), and
 set the system clock; other than that, it's a clean installation.
 
 I'm now trying to install Postfix, and the problem I'm running into is
 that I cannot create new user accounts. I created several user
 accounts during installation, and they seem to be fine. But when I
 [manually] create entries in /etc/passwd, master.passwd, and group,
 the entries are 'ignored' -- e.g., a chown [newuser] [filename]
 command fails, attempts to su from root into the user account fail,
 etc. When I try to create the user via adduser (using the standard
 defaults), the account creation step fails with the following error:
 
 pw: user '[newuser]' disappeared during update
 
 Again, attempts to 'access' the user (i.e., chmod, etc.) will
 fail. Interestingly, though, if I try to re-create the user, adduser
 tells me that the user already exists -- and a check of the relevant
 files confirms that the entries are there.

It sounds like you've messed up your user database.  Try running
pwd_mkdb(8) by hand to get it straightened out.  In future, remember
not to edit passwd and so forth by hand; stick with adduser(8) and/or
vipw(8) to avoid shooting yourself in the foot like this.
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Cannot Add User

2004-02-04 Thread Vince Sabio
** Sometime around 09:21 -0500 02/04/2004, Lowell Gilbert sent everyone:
Vince Sabio [EMAIL PROTECTED] writes:

[...]
  I'm now trying to install Postfix, and the problem I'm running into is
 that I cannot create new user accounts. I created several user
 accounts during installation, and they seem to be fine. But when I
 [manually] create entries in /etc/passwd, master.passwd, and group,
 the entries are 'ignored' -- e.g., a chown [newuser] [filename]
 command fails, attempts to su from root into the user account fail,
 etc. When I try to create the user via adduser (using the standard
 defaults), the account creation step fails with the following error:
  pw: user '[newuser]' disappeared during update

It sounds like you've messed up your user database.  Try running
pwd_mkdb(8) by hand to get it straightened out.  In future, remember
not to edit passwd and so forth by hand; stick with adduser(8) and/or
vipw(8) to avoid shooting yourself in the foot like this.
I have to wonder if this is unique to the BSDs; I've been using 
Solaris for nearly a decade now, and the _only_ way I've ever created 
user accounts is manually -- by editing /etc/passwd, shadow, and 
group files, creating user directories, etc. I've never had a problem 
with it before. (I'm pretty sure I've done the same under Linux, 
too.) Running adduser is fine for simple user accounts -- but there 
are few user accounts on a typical server. The problem with adduser 
is that it isn't well suited to things like accounts with no home 
directories or login shells, disabled passwords (not the same as a 
locked account), etc.

Either way, I tried running pwd_mkdb -C /etc/passwd, and it reported 
a format error on line 3 -- which happens to be the root account, and 
is the first real data line in the file. Moreover, it's a line that I 
didn't modify. It reported no errors on /etc/master.passwd, so I 
copied and modified it into a passwd file -- and pwd_mkdb then 
reported no errors on the new passwd file. However, that action also 
prevented any new logins, and running passwd didn't fix the problem.

So, after mucking around with pwd_mkdb for a while, I opted to simply 
reinstall the OS -- it was still a rather new installation, and I 
wanted to increase the /usr partition, anyway. After completing the 
new FreeBSD installation, the first thing I did upon logging in was 
run pwd_mkdb on /etc/passwd, and it still reported a format error on 
line 3. I then manually added the necessary users, and this time the 
postfix installation ran to completion.

While it's possible that I messed up the format on the original try, 
it's unlikely -- I checked it over a dozen times before going in 
search of a FreeBSD list on which to ask the question. I'm thinking 
that there might have been something else in the mix. But either way, 
the clean install fixed it (though admittedly it was a rather 
Draconian fix).
--

__
Vince Sabio  [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Cannot Add User

2004-02-04 Thread Peter Risdon
** Sometime around 09:21 -0500 02/04/2004, Lowell Gilbert sent everyone:

Vince Sabio [EMAIL PROTECTED] writes:

[...]
 I'm now trying to install Postfix, and the problem I'm running into is
that I cannot create new user accounts. I created several user
accounts during installation, and they seem to be fine. But when I
[manually] create entries in /etc/passwd, master.passwd, and group,
the entries are 'ignored' -- e.g., a chown [newuser] [filename]
command fails, attempts to su from root into the user account fail,
etc. When I try to create the user via adduser (using the standard
defaults), the account creation step fails with the following error:
 pw: user '[newuser]' disappeared during update

It sounds like you've messed up your user database. Try running
pwd_mkdb(8) by hand to get it straightened out. In future, remember
not to edit passwd and so forth by hand; stick with adduser(8) and/or
vipw(8) to avoid shooting yourself in the foot like this.

I notice you don't recommend pw(8). I have some scripts that use pw(8) 
to add users with things like a /nonexistent shell - they do other stuff 
to do with quotas, smbpasswd and so on and allow it all to be managed in 
a single operation from a web interface. Am I storing up problems for 
myself like this? It has been fine so far.

PWR.

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Cannot Add User

2004-02-04 Thread Lowell Gilbert
Vince Sabio [EMAIL PROTECTED] writes:

 ** Sometime around 09:21 -0500 02/04/2004, Lowell Gilbert sent everyone:
 Vince Sabio [EMAIL PROTECTED] writes:
 
 [...]
I'm now trying to install Postfix, and the problem I'm running into is
   that I cannot create new user accounts. I created several user
   accounts during installation, and they seem to be fine. But when I
   [manually] create entries in /etc/passwd, master.passwd, and group,
   the entries are 'ignored' -- e.g., a chown [newuser] [filename]
   command fails, attempts to su from root into the user account fail,
   etc. When I try to create the user via adduser (using the standard
   defaults), the account creation step fails with the following error:
 
pw: user '[newuser]' disappeared during update
 
 It sounds like you've messed up your user database.  Try running
 pwd_mkdb(8) by hand to get it straightened out.  In future, remember
 not to edit passwd and so forth by hand; stick with adduser(8) and/or
 vipw(8) to avoid shooting yourself in the foot like this.
 
 I have to wonder if this is unique to the BSDs; I've been using
 Solaris for nearly a decade now, and the _only_ way I've ever created
 user accounts is manually -- by editing /etc/passwd, shadow, and group
 files, creating user directories, etc. I've never had a problem with
 it before. (I'm pretty sure I've done the same under Linux, too.)

Right.  By default, FreeBSD uses databases to hold account
information; the passwd file is present only for backward
compatibility, and the master.passwd is used only as an *input* 
from which the databases are created.

 Running adduser is fine for simple user accounts -- but there are few
 user accounts on a typical server. The problem with adduser is that it
 isn't well suited to things like accounts with no home directories or
 login shells, disabled passwords (not the same as a locked account),
 etc.

Normally I do those directly with vipw(8).  If I were automating
those, I'd use pw(8).

 Either way, I tried running pwd_mkdb -C /etc/passwd, and it reported a
 format error on line 3 -- which happens to be the root account, and is
 the first real data line in the file.

That file has a slightly different format:  
you wanted pwd_mkdb /etc/master.passwd

   Moreover, it's a line that I
 didn't modify. It reported no errors on /etc/master.passwd, so I
 copied and modified it into a passwd file -- and pwd_mkdb then
 reported no errors on the new passwd file. However, that action also
 prevented any new logins, and running passwd didn't fix the problem.

Here we've got an actual problem.  There were a number of chances for
bogus data to creep into the file, but in case of future problems,
note that master.passwd is among the things that gets automatically
backed up into /var/backups.

 So, after mucking around with pwd_mkdb for a while, I opted to simply
 reinstall the OS -- it was still a rather new installation, and I
 wanted to increase the /usr partition, anyway. After completing the
 new FreeBSD installation, the first thing I did upon logging in was
 run pwd_mkdb on /etc/passwd, and it still reported a format error on
 line 3. I then manually added the necessary users, and this time the
 postfix installation ran to completion.

The postfix port adds all the necessary users for you, and does it
correctly.  [The next time you add a *real* new user, your postfix
changes will be wiped out by pwd_mkdb.]

 While it's possible that I messed up the format on the original try,
 it's unlikely -- I checked it over a dozen times before going in
 search of a FreeBSD list on which to ask the question. I'm thinking
 that there might have been something else in the mix. But either way,
 the clean install fixed it (though admittedly it was a rather
 Draconian fix).

Just use vipw(8) to make your changes to the password database, and
all the tricky bits will be handled for you. 
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]