old-www/LDP/lame/LAME/linux-admin-made-easy/disabling-user-accounts.html

193 lines
3.2 KiB
HTML

<HTML
><HEAD
><TITLE
>Disabling User Accounts</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.63
"><LINK
REL="HOME"
TITLE="Linux Administration Made Easy"
HREF="index.html"><LINK
REL="UP"
TITLE="General System Administration Issues"
HREF="administrative-issues.html"><LINK
REL="PREVIOUS"
TITLE="Changing User Passwords"
HREF="changing-user-passwords.html"><LINK
REL="NEXT"
TITLE="Removing User Accounts"
HREF="removing-user-accounts.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux Administration Made Easy</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="changing-user-passwords.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 6. General System Administration Issues</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="removing-user-accounts.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="DISABLING-USER-ACCOUNTS"
>6.4. Disabling User Accounts</A
></H1
><P
>To disable a user account, edit, as root, the
``<TT
CLASS="LITERAL"
><TT
CLASS="FILENAME"
>/etc/shadow</TT
></TT
>'' file (assuming
you're using shadow passwords; if not, edit the
``<TT
CLASS="LITERAL"
><TT
CLASS="FILENAME"
>/etc/passwd</TT
></TT
>'' file instead),
and replace the password (which is stored in its encrypted form) with a
``*'' asterisk character. All Unix passwords, regardless of length (up
to a maximum of 8 characters), are stored in the password file as
encrypted strings of 13 characters. Therefore, by replacing the password
with a single ``*'' character, it is impossible for the user to sign
in.</P
><DIV
CLASS="NOTE"
><BLOCKQUOTE
CLASS="NOTE"
><P
><B
>Note: </B
>Note: This method will require you to assign a new password to
the user if you re-enable the account, since the encrypted password field
will have been replaced. One solution to this which seems to be popular
among system administrators is to simply prefix the ``*'' asterisk
character in front of the encrypted password to disable the account, and
simply removing the asterisk to enable it.</P
></BLOCKQUOTE
></DIV
><P
>For more information on the
``<TT
CLASS="LITERAL"
><TT
CLASS="FILENAME"
>/etc/passwd</TT
></TT
>'' and
``<TT
CLASS="LITERAL"
><TT
CLASS="FILENAME"
>/etc/shadow</TT
></TT
>'' files, see <A
HREF="shadow-file-formats.html"
>Section 6.6</A
> below.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="changing-user-passwords.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="removing-user-accounts.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Changing User Passwords</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="administrative-issues.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Removing User Accounts</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>