Practical Professional Linux — Foundation

Chapter 2 · Skill Level: Foundation

System Access & Basic Navigation

Authenticate, orient, and move through a Linux system the way an administrator does.

This chapter establishes the non-negotiable fundamentals every Linux professional performs dozens of times a day: authenticating to a host, understanding the filesystem hierarchy, navigating efficiently, and interpreting file permissions. The commands here are identical across Ubuntu/Debian, RHEL-family (Rocky, AlmaLinux, RHEL), and most other modern distributions; distribution-specific differences are flagged where they matter.

2.1 Logging Into Linux

A Linux system can be accessed locally at the console or remotely over the network. In production environments, remote access via SSH is by far the dominant method.

Console and virtual consoles

At a physical console you receive a login: prompt. Authentication is silent — no characters echo while typing a password. Most distributions provide several text-based virtual consoles, reachable with Ctrl+Alt+F2 through Ctrl+Alt+F6; the graphical session typically occupies F1 or F2.

Remote access with SSH

SSH establishes an encrypted channel to a remote host. The general form is ssh user@host.

Connecting with SSH
ssh [email protected]
ssh -p 2222 [email protected]      # non-default port
ssh -i ~/.ssh/id_ed25519 deploy@host  # explicit key file

Key-based authentication (the professional default)

Set up SSH keys (ed25519 preferred over older RSA)
# 1. Generate a modern key pair on your workstation
ssh-keygen -t ed25519 -C "deploy@workstation"
 
# 2. Install the public key on the server
ssh-copy-id [email protected]
 
# 3. Verify, then enforce key-only auth server-side
ssh [email protected]

Post-login verification

2.2 The Filesystem Hierarchy

Linux presents a single, unified directory tree rooted at /. There are no drive letters; additional storage devices are mounted into the tree at chosen directories. The layout follows the Filesystem Hierarchy Standard (FHS), which makes systems predictable across distributions.

Path Purpose
/ Root of the entire hierarchy.
/etc System-wide configuration files (text).
/home Regular users’ home directories.
/root The root user’s home directory.
/var Variable data: logs (/var/log), spool, web content, databases.
/usr Read-only user-space programs and libraries.
/bin, /sbin Essential commands; on modern systems these are symlinks into /usr.
/tmp Temporary files, often cleared on reboot.
/dev Device nodes.
/proc, /sys Virtual filesystems exposing kernel and process state.

2.3 Navigating the Filesystem

The three core commands

Command Function
pwd Print the absolute path of the working directory.
ls List directory contents.
cd Change the working directory.

The ls command is rarely used bare. Its common options:

Frequently used ls options
ls -l      # long listing: type, permissions, owner, size, mtime
ls -a      # include dotfiles (hidden entries)
ls -h      # human-readable sizes (with -l)
ls -lt     # sort by modification time, newest first
ls -lhS    # long, human sizes, largest first

Absolute vs. relative paths

An absolute path begins at the root and is unambiguous from anywhere: /var/log/syslog. A relative path is interpreted from the current directory: ../config/app.conf. Two special entries appear in every directory: . (the current directory) and .. (its parent).

Shortcut Meaning
cd ~ or cd Return to your home directory.
cd – Switch to the previous working directory.
cd .. Move up one level.
cd ../.. Move up two levels.

2.4 Understanding Permissions

Every filesystem object has an owner, an owning group, and a permission set governing three operations — read (r), write (w), execute (x) — for three classes: owner (u), group (g), and others (o).

Octal notation

Each class’s permissions sum to a single digit: r=4, w=2, x=1. Three digits describe owner, group, and others.

Octal Symbolic / typical use
644 rw-r–r– — regular files (config, documents).
755 rwxr-xr-x — directories and executables.
600 rw——- — secrets; required for SSH private keys.
640 rw-r—– — readable by a trusted group only.
777 rwxrwxrwx — world-writable; a security risk, avoid.

2.5 Finding Help

Built-in documentation
man ls          # full manual page; q to quit, /pattern to search
ls --help       # concise option summary
apropos network # search manual page descriptions by keyword
type -a ls      # is it a binary, builtin, alias, or function?

Essential keyboard shortcuts

Keys Action
Tab Command and path completion.
Ctrl+R Reverse-search command history.
Ctrl+C Interrupt the foreground process.
Ctrl+A / Ctrl+E Jump to start / end of the line.
Ctrl+L Clear the screen.

2.6 Guided Lab: Orientation Drill

Objective: authenticate, map your surroundings, and read permissions on real system files. Estimated time: 20–25 minutes.

  • Connect to your lab host over SSH and run id. Record your UID, primary group, and supplementary groups.
  • From your home directory, capture a baseline: pwd; ls -la. Identify two dotfiles and state their purpose.
  • Navigate to /var/log and list the five largest files: ls -lhS | head -5.
  • Inspect /etc/ssh/sshd_config permissions with ls -l. Who may read it? Should others be able to?
  • Examine /tmp with ls -ld /tmp. Note the trailing t in its permission string and explain what the sticky bit prevents.
  • Return to your previous directory with cd – and confirm with pwd.
  • Use man -k to find a command that reports free disk space, then read its manual page.

2.7 Troubleshooting Common Access Issues

Symptom Likely cause and resolution
ssh: connect to host … Connection refused sshd not running or firewall blocking the port. Verify the service (systemctl status ssh) and the firewall rule; confirm the correct port.
Permission denied (publickey) Server rejects password auth and your key is not installed or has wrong permissions. Ensure ~/.ssh is 700 and the private key is 600; reinstall with ssh-copy-id.
Host key verification failed The server’s host key changed. If expected (rebuild), remove the stale entry with ssh-keygen -R host. If unexpected, investigate — it can indicate interception.
bash: cmd: command not found Package not installed or not on PATH. Install via the distro package manager; verify with which/type.
Permission denied (on a file) Insufficient rights or wrong ownership. Inspect with ls -l; correct ownership/permissions rather than using 777.

2.8 Review & Assessment

Knowledge check

  • State the difference between an absolute and a relative path, with one example of each.
  • Convert rwxr-x— to octal, and 640 to symbolic notation.
  • Which sshd_config directives disable password and root login, and how do you safely apply them?
  • What does the sticky bit accomplish on /tmp, and how does it appear in ls -l output?
  • Name the command that searches manual page descriptions by keyword.

Command-writing tasks

  • Long-list /etc including hidden files, sorted by modification time, newest last.
  • Generate an ed25519 key pair and copy it to [email protected].
  • Set a private key file to the only permissions SSH will accept.

Key Takeaways

  • SSH with key-based authentication is the professional standard for remote access; disable password and root login on production hosts.
  • Linux uses a single FHS-compliant tree rooted at /; storage is mounted into it, not assigned drive letters.
  • pwd, ls, and cd are core navigation; master absolute vs. relative paths and the . and .. entries.
  • Permissions combine three operations across three classes; be fluent converting between symbolic and octal, including special bits.
  • man, –help, and apropos are authoritative, offline references — use them before external searches.