Who Is Logged In?


You know now that Linux is a multiuser system, and, consequently, it is possible for many remote users to be logged in to your Linux machine simultaneously , with each using their his account. But from where?

A traditional UNIX system would often have a (sometimes huge) number of serial terminals connected to it. Each terminal was basically just a screen with an attached keyboard (or maybe just a printer), capable of sending characters to the UNIX host and displaying characters received from it. Does this sound familiar? The term terminal is still used today to identify a window in which users run shells and type commands.

Although serial terminals can still be seen today, they ve been largely replaced by network connections. Besides the computer itself, the network is the place from which most login requests are likely to come. In subsequent chapters of this book, you ll see how to manage networking and services that allow remote login. This feature in particular is really empowering and useful, but sometimes not desirable.

The following table contains a list of commands that you can use to find out who logs into your system and what they are doing when they re there. Even though these commands are some of the oldest of all UNIX commands, they are still very much in use today:

Command

Description

Who

Used to check who is logged in, and from where

W

Used to check who is logged in, and what they are doing (that is, what program they are running at the moment)

Whoami

Displays the username of the invoking user

Last

Used to check who logged in in the past

Lastb

If /var/log/btmp exists, shows a list of failed login attempts (disabled by default)

For further details, each command has its own manual page, accessible through the man command, for example with man whoami .




Beginning Fedora 2
Beginning Fedora 2
ISBN: 0764569961
EAN: 2147483647
Year: 2006
Pages: 170

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net