SI Learning
0% read · Practice is tracked separately
← My learning
Version 1 · Chapter 10Reading mode

Understand identities and sessions

By the end: Identify the effective user, current sessions, and where elevated access comes from.

The idea

A process runs with an identity and group memberships. That identity may differ from the person who originally logged in. Observe first; do not switch accounts or change a password on a shared machine merely to complete a lesson. Session tools depend on the distribution and whether login accounting is enabled.

Your command toolkit

whoami

What it solves: Identify the effective user.

bash
whoami

Reports the user associated with the current effective UID. After an authorized identity change, it may differ from the original login user.

who

What it solves: Inspect recorded login sessions.

bash
who

Reads login accounting information. Containers and some modern sessions may not appear in this traditional record.

w

What it solves: See logged-in sessions and activity.

bash
w

Combines session details with uptime and load information. It is a different command from finger.

groups

What it solves: Inspect current group memberships.

bash
groups

Groups contribute to permission checks. A membership change may require a new login session to take effect.

finger

What it solves: Read account information where supported.

bash
finger "$(whoami)"

An optional, older tool. Limit practice to your own local account; remote finger services may be absent and can expose personal information.

last

What it solves: Review recorded login history.

bash
last -n 5

Reads historical login accounting, if available. Missing records do not prove that no one logged in.

login

What it solves: Understand how a login session starts.

bash
man login

Study the installed implementation. Running login can replace or change a session, so this course uses its manual rather than opening another account.

passwd

What it solves: Inspect password status without changing it.

bash
passwd -S

On common shadow-utils systems, -S reports your own account's password status. Running passwd without that option starts a password change.

su

What it solves: Understand switching to another identity.

bash
su --help

su starts a shell or command as another user, subject to authentication. A login shell changes more environment settings than a simple user switch.

sudo

What it solves: Inspect how authorized elevation works.

bash
sudo -l

Lists commands your policy permits and may ask for authentication. sudo is an authorization boundary, not a general fix for any error.

Before you move on

Try the guided lab below. Compare the result with the explanation, then record your reasoning in the workbook. A missing optional program or a restricted environment is something to explain, not a reason to change system settings blindly.

Practice with evidence

  1. Predict the result
  2. Run the guided lab
  3. Compare the output
  4. Explain your choice

A worked example

Guided lab

bash
whoami
groups
w
who

What to expect: Your effective username and groups, plus whatever session information your environment records. Empty session listings are possible.

Make it yours: Record the distinction between effective identity and login history. Explain when a permission error should be investigated rather than retried with sudo.

Read further

Apply what you learned

Your private practice

What does whoami report?

Answers are private. Completion requires the correct knowledge-check answer and a written response when an activity is included.

Restore a downloaded workbook

Choose a recovery file for this course and version. Review the recovered copy before saving it to your account.

Ask a question or report a problem

Describe what needs attention. Your private answer is shared only if you select the option below.

All learning paths
SI CENTRALIZATION · LEARN

Linux Command Line: from first command to confident practice

24 chapters · Your own pace

0 of 24 chapters complete