Re: several questions
From: Tony Walton (tony.walton_at_s_u_n.com)
Date: 12/04/03
- Next message: Joe Seigh: "Re: race on multi-processor solaris"
- Previous message: joe durusau: "Re: Window focus "follow mouse" problem."
- In reply to: Alex Li: "several questions"
- Next in thread: Alex Li: "Re: several questions"
- Reply: Alex Li: "Re: several questions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 04 Dec 2003 13:03:52 +0000
Alex Li wrote:
>
> HI,I have several question in system administration and I hope anyone
> who knows could give me the answers
>
> 1,An existing users in the system suddenly can't log in the
> system,what will the reasons to be and what would the most likely
> reasons be?And how could I restore the users account with least loss?
>
>
Depends what the problem is. From the looks of your next question,
somebody's broken /etc/passwd or /etc/shadow. Log in as root - ONE
person, please - and run /etc/pwck to see if there's any damage to
/etc/passwd. Then fix it, which (since the passwd/shadow file may well
be too broken to use any of the tools designed for it such as
/bin/passwd and /usr/bin/usermod), may in this instance involve
hand-editing the file(s). Be CAREFUL.
>
> 2If /etc/password is edited simulteneously by several users with root
> previlege,what will the password be after all finish editing it?
(Ignoring the facts there's no such file as /etc/password and that the
password isn't stored in /etc/passwd)
This is, as they say, indeterminate. If you're using a simple text
editor like vi or dtpad that doesn't do any locking, the password will
be the one set by the last one to write the file (probably). Of course,
if two people hit "save" at almost exactly the same time, the file might
well be completely hosed as one editor starts to write it before the
other one's finished. This is asking for trouble - *don't do it*.
If you *must* edit /etc/passwd and/or /etc/shadow with a text editor, be
sure to run /etc/pwck afterwards before logging out as root; this way
you've a reasonable chance of catching gross syntax errors in the files
before you've completely burned your boats. Of course the rule of thumb
still is "don't".
Any good method to prevent
> them from editing the password at the same time and let them edit it
> one by one..?
>
"Don't give several people the root password" is one good method.
"use the tools designed to manipulate the password file" is another.
Examples are the passwd, pwconv, useradd, userdel and usermod commands.
-- Tony
- Next message: Joe Seigh: "Re: race on multi-processor solaris"
- Previous message: joe durusau: "Re: Window focus "follow mouse" problem."
- In reply to: Alex Li: "several questions"
- Next in thread: Alex Li: "Re: several questions"
- Reply: Alex Li: "Re: several questions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|