233 lines
5.0 KiB
HTML
233 lines
5.0 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>What happens when you log in?</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="The Unix and Internet Fundamentals HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="What happens when you switch on a computer?"
|
|
HREF="bootup.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="What happens when you run programs
|
|
after boot time?"
|
|
HREF="running-programs.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>The Unix and Internet Fundamentals HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="bootup.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="running-programs.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="login"
|
|
></A
|
|
>4. What happens when you log in?</H1
|
|
><P
|
|
>When you log in, you identify yourself to the computer. On modern
|
|
Unixes you will usually do this through a graphical display manager. But
|
|
it's possible to switch virtual consoles with a Ctrl-Shift key sequence and
|
|
do a textual login, too. In that case you go through the
|
|
<B
|
|
CLASS="command"
|
|
>getty</B
|
|
> instance watching that console tto call the
|
|
program <B
|
|
CLASS="command"
|
|
>login</B
|
|
>.</P
|
|
><P
|
|
>You identify yourself to the display manager or
|
|
<B
|
|
CLASS="command"
|
|
>login</B
|
|
> with a login name and password. That login name
|
|
is looked up in a file called /etc/passwd, which is a sequence of lines
|
|
each describing a user account.</P
|
|
><P
|
|
>One of these fields is an encrypted version of the account password
|
|
(sometimes the encrypted fields are actually kept in a second /etc/shadow
|
|
file with tighter permissions; this makes password cracking harder). What
|
|
you enter as an account password is encrypted in exactly the same way, and
|
|
the <B
|
|
CLASS="command"
|
|
>login</B
|
|
> program checks to see if they match. The
|
|
security of this method depends on the fact that, while it's easy to go
|
|
from your clear password to the encrypted version, the reverse is very
|
|
hard. Thus, even if someone can see the encrypted version of your
|
|
password, they can't use your account. (It also means that if you forget
|
|
your password, there's no way to recover it, only to change it to something
|
|
else you choose.)</P
|
|
><P
|
|
>Once you have successfully logged in, you get all the privileges
|
|
associated with the individual account you are using. You may also be
|
|
recognized as part of a
|
|
<I
|
|
CLASS="firstterm"
|
|
>group</I
|
|
>.
|
|
A group is a named collection of users set up by the system administrator.
|
|
Groups can have privileges independently of their members’ privileges. A
|
|
user can be a member of multiple groups. (For details about how Unix
|
|
privileges work, see the section below on <A
|
|
HREF="disk-layout.html#permissions"
|
|
>permissions</A
|
|
>.)</P
|
|
><P
|
|
>(Note that although you will normally refer to users and groups by
|
|
name, they are actually stored internally as numeric IDs. The password
|
|
file maps your account name to a user ID; the
|
|
<TT
|
|
CLASS="filename"
|
|
>/etc/group</TT
|
|
>
|
|
file maps group names to numeric group IDs. Commands that deal with
|
|
accounts and groups do the translation automatically.)</P
|
|
><P
|
|
>Your account entry also contains your <I
|
|
CLASS="firstterm"
|
|
>home
|
|
directory</I
|
|
>, the place in the Unix file system where
|
|
your personal files will live. Finally, your account entry also sets your
|
|
<I
|
|
CLASS="firstterm"
|
|
>shell</I
|
|
>,
|
|
the command interpreter that <B
|
|
CLASS="command"
|
|
>login</B
|
|
> will start up to
|
|
accept your commmands.</P
|
|
><P
|
|
>What happens after you have successfully logged in depends on how you
|
|
did it. On a text console, <B
|
|
CLASS="command"
|
|
>login</B
|
|
> will launch a shell
|
|
and you'll be off and running. If you logged in through a display
|
|
manager, the X server will bring up your graphical desktop and you will
|
|
be able to run programs from it — either through the menus, or
|
|
through desktop icons, or through a <I
|
|
CLASS="firstterm"
|
|
>terminal
|
|
emulator</I
|
|
> running a <I
|
|
CLASS="firstterm"
|
|
>shell</I
|
|
>.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="bootup.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="running-programs.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>What happens when you switch on a computer?</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>What happens when you run programs
|
|
after boot time?</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |