$
Learn Linux handbook
en
XP:0

Chapter 16 of 17

Secure identities and remote access

Understand users, groups, SSH trust, and least privilege.

The mental model.

Users have numeric UIDs and primary and supplementary groups. /etc/passwd describes accounts; password hashes are kept separately in /etc/shadow. Use account-management tools instead of editing these databases casually.

usermod -aG adds supplementary group membership; omitting -a can replace the existing list. A new login is usually needed for a session to gain updated group membership. Verify with id in the new session.

SSH authenticates the server with a host key and the client with a configured method such as a public key. Verify a new server’s fingerprint through a trusted channel. Never share the private key; install only the public key on the destination.

Test key-based login in a second session before disabling password authentication. Keep a recovery path. Restrict key file permissions and use a passphrase. A changed host key deserves investigation rather than automatic deletion of the warning.

Read it. Predict it. Try it.

Before running these commands, predict what each line will change or print. Launch a quest below to open the simulated terminal.

whoami
id
groups
who
w

Inspect your identity, effective group membership, and active sessions before changing access rules.

Check your understanding

Explain the why.

Which SSH key may be copied to the server?

Put it into practice.

Complete the exercises, then try the Boss Challenge without hints. Each quest checks its own objectives. You can revisit this chapter at any time.

Prefer to read first?

Make the learning stick.

Close the explanation and describe the main idea in your own words. Change a filename or input and predict the outcome. Tomorrow, repeat a quest without hints. Then apply it in a disposable real Linux environment.

Open the real-system labs →