Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
How could root get the history of a particular user?
Is it possible to get if the user don't even have home directory??
If it is configured by default, how to configure it ?
Thnanks in advance
excerpt from 'man history;
history - GNU History Library
The GNU History Library is Copyright (C) 1989-2002 by the Free Software Foundation, Inc.
Many programs read input from the user a line at a time. The GNU History library is able to keep
track of those lines, associate arbitrary data with each line, and utilize information from pre-
vious lines in composing new ones.
The history library supports a history expansion feature that is identical to the history expan-
sion in bash. This section describes what syntax features are available.
History expansions introduce words from the history list into the input stream, making it easy to
repeat commands, insert the arguments to a previous command into the current input line, or fix
errors in previous commands quickly.
History expansion is usually performed immediately after a complete line is read. It takes place
in two parts. The first is to determine which line from the history list to use during substitu-
tion. The second is to select portions of that line for inclusion into the current one. The
line selected from the history is the event, and the portions of that line that are acted upon
are words. Various modifiers are available to manipulate the selected words. The line is broken
into words in the same fashion as bash does when reading input, so that several words that would
otherwise be separated are considered one word when surrounded by quotes (see the description of
history_tokenize() below). History expansions are introduced by the appearance of the history
expansion character, which is ! by default. Only backslash (\) and single quotes can quote the
history expansion character.
Please explain or clarify how the user you are speaking of is logging into the system?
does this work even if the user dont have a home directory?
Nope. But a user must have a HOME, maybe not under the /home directory/partition but any user which is able to login through ssh/putty has a HOME somewhere and it is specified in /etc/passwd. Anyway, since you're root, you can switch to the user login without password and check the history using the history built-in, as shown by onebuck above.
If you want to keep trace of the users activity, you may want to consider an audit software, e.g. psacct.