Linux System Administration Overview
24 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which of the following are benefits of open source software for the user? (Select all that apply)

  • Training (correct)
  • Control (correct)
  • Stability (correct)
  • Security (correct)
  • What is the purpose of the /etc/passwd file?

    The /etc/passwd file stores information about local users in a system, including their usernames, user IDs, group IDs, home directories, and default login shells.

    What is the default shell in Red Hat Enterprise Linux?

  • Bash (correct)
  • Zsh
  • Fish
  • Korn
  • The mkdir command creates directories, while the cp command copies files.

    <p>True (A)</p> Signup and view all the answers

    What does the ls -l command do?

    <p>The <code>ls -l</code> command displays a long listing of files and directories in the current directory, showing information about their permissions, ownership, size, modification time, and file types. It also shows hidden files.</p> Signup and view all the answers

    What is the purpose of the pwd command?

    <p>The <code>pwd</code> command displays the current working directory's full path.</p> Signup and view all the answers

    What is the difference between a symbolic link and a hard link?

    <p>A <strong>symbolic link</strong> is a special type of file that points to another file or directory. A <strong>hard link</strong> creates a duplicate file name that points to the same data as the original file. Hard links cannot point to directories, but symbolic links can.</p> Signup and view all the answers

    The rm command by default, can only remove files and not directories.

    <p>True (A)</p> Signup and view all the answers

    What is the difference between su and sudo?

    <p><code>sudo</code> runs commands as root without fully switching to the root user account (A), Both are alternatives to become root user (B), Both grant temporary root access (C), <code>su</code> switches the user to the root user account (D)</p> Signup and view all the answers

    What is the purpose of the history command?

    <p>All of the above (D)</p> Signup and view all the answers

    What are shell variables used for?

    <p>Shell variables store values and modify the shell's behavior, simplifying commands and setting common options for programs.</p> Signup and view all the answers

    What is the primary difference between the useradd and usermod commands?

    <p>The <code>useradd</code> command creates new user accounts, while the <code>usermod</code> command modifies existing user accounts.</p> Signup and view all the answers

    What is the difference between the groupadd and groupmod commands?

    <p>The <code>groupadd</code> command creates new groups, while the <code>groupmod</code> command modifies existing groups.</p> Signup and view all the answers

    A user can belong to both primary and supplementary groups.

    <p>True (A)</p> Signup and view all the answers

    What is the purpose of password aging?

    <p>Password aging helps to improve security by forcing users to change their passwords regularly, reducing the risk of compromised accounts and unauthorized access. Typically, password aging policies define minimum and maximum password ages, warning periods before expiration, and inactivity periods for locking accounts.</p> Signup and view all the answers

    The chage command is used to manage password aging policies for local user accounts.

    <p>True (A)</p> Signup and view all the answers

    What is the purpose of the usermod -L command?

    <p>The <code>usermod -L</code> command locks a user account, preventing the user from logging in.</p> Signup and view all the answers

    The /sbin/nologin shell is a special shell that prevents a user from logging in interactively.

    <p>True (A)</p> Signup and view all the answers

    What are the three main categories of user accounts?

    <p>The three main categories of user accounts are: <strong>superuser (root)</strong>, <strong>system users</strong>, and <strong>regular users</strong>.</p> Signup and view all the answers

    The sudo command allows users to execute commands as root without fully switching to the root user account.

    <p>True (A)</p> Signup and view all the answers

    What is the main purpose of the /etc/sudoers file?

    <p>The <code>/etc/sudoers</code> file is the central configuration file for managing and configuring the <code>sudo</code> command in Linux. It defines which users are allowed to execute specific commands as root and what commands they can run.</p> Signup and view all the answers

    What is the purpose of the PATH environment variable?

    <p>The <code>PATH</code> environment variable is a list of directories where the shell searches for executable programs when you run a command.</p> Signup and view all the answers

    The tee command is used for copying command output to both the terminal and a file.

    <p>True (A)</p> Signup and view all the answers

    When using the sudo command, the user's PATH environment is modified to include the root user's PATH.

    <p>False (B)</p> Signup and view all the answers

    Flashcards

    What is Linux?

    A free and open-source operating system known for its flexibility, security, and collaborative development. It powers a wide range of devices and systems.

    What is a Linux distribution?

    A distribution of Linux is a complete operating system that includes the Linux kernel, user programs, libraries, and management tools. It's packaged and ready to install.

    What is Open Source Software?

    Code with publicly accessible source code, allowing for study, modification, and sharing. It promotes collaboration, transparency, and cost-effectiveness.

    What is a Permissive license?

    It allows you to use the code in any way, including making it part of proprietary software. It doesn't require you to share changes or keep it open.

    Signup and view all the flashcards

    What is a Copyleft license?

    Derivative works (code with changes) must be open-source as well. This emphasizes sharing and community collaboration.

    Signup and view all the flashcards

    What is Red Hat?

    Red Hat is a leading provider of open-source solutions including Red Hat Enterprise Linux (RHEL), JBoss middleware, and cloud technologies. They support open-source communities and help customers use their software.

    Signup and view all the flashcards

    What is Fedora?

    A community-driven Linux distribution famous for its rapid innovation and cutting-edge features.

    Signup and view all the flashcards

    What is Red Hat Enterprise Linux (RHEL)?

    A commercially supported Linux distribution that's a leading platform for open-source computing. It's known for its stability and long-term support.

    Signup and view all the flashcards

    What is CentOS Stream?

    CentOS Stream is a community project that serves as a bridge between Fedora and Red Hat Enterprise Linux (RHEL). It's a more stable alternative to Fedora and allows users to contribute to RHEL's development.

    Signup and view all the flashcards

    What is RHEL for Edge?

    RHEL for Edge is an image-based variant of RHEL optimized for managing edge computing environments. It's designed for efficiency, customization, and quick security fixes.

    Signup and view all the flashcards

    What is Red Hat CoreOS (RHCOS)?

    A container host built from RHEL components and managed as part of Red Hat's OpenShift Container Platform (RHOCP). It's not a standalone operating system.

    Signup and view all the flashcards

    What is Red Hat Universal Base Image (UBI)?

    A freely redistributable derivative of RHEL that serves as a foundation for developing cloud-native and web applications within containers.

    Signup and view all the flashcards

    What is a Command Line Interface (CLI)?

    A text-based interface for interacting with a computer system using commands.

    Signup and view all the flashcards

    What is a Shell?

    A program that interprets and executes commands in a text-based environment.

    Signup and view all the flashcards

    What is a Prompt?

    The prompt indicates that the shell is ready to receive commands.

    Signup and view all the flashcards

    What is a Terminal?

    A program that provides a display for output and a keyboard for input, allowing interaction with the shell.

    Signup and view all the flashcards

    What is the structure of a command?

    Commands entered at the shell prompt typically have three parts: a command, options, and arguments.

    Signup and view all the flashcards

    What is a Physical Console?

    A physical keyboard and display directly connected to the computer.

    Signup and view all the flashcards

    What is a Virtual Console?

    Multiple independent login sessions accessed using Ctrl+Alt+Function keys.

    Signup and view all the flashcards

    What is a Graphical Environment?

    A graphical environment with icons, windows, and menus that makes it easier to use the shell.

    Signup and view all the flashcards

    What is Secure Shell (SSH)?

    A secure encrypted connection for remote access to a computer. It allows you to manage a computer from a different location.

    Signup and view all the flashcards

    What is Public Key Authentication?

    Provides passwordless login using private (local) and public (remote) keys, reducing the risk of attacks based on stolen or guessed passwords.

    Signup and view all the flashcards

    What is a File System?

    A file system is a hierarchical tree structure used by Linux to organize files and directories.

    Signup and view all the flashcards

    What is the Root Directory (/)?

    The root directory, denoted by /, is the top of the file system hierarchy.

    Signup and view all the flashcards

    What is a Path?

    A path specifies the location of a file or directory within the file system, using / as the directory separator.

    Signup and view all the flashcards

    What is an Absolute Path?

    Specifies the complete location of a file, starting from the root directory (/).

    Signup and view all the flashcards

    What is a Relative Path?

    Specifies the location of a file relative to the current working directory. It doesn't start with /.

    Signup and view all the flashcards

    What is the touch command?

    It creates an empty file or updates its timestamp.

    Signup and view all the flashcards

    What is the ls command?

    It lists the contents of a directory. Options like -l, -a, and -R provide different views.

    Signup and view all the flashcards

    What is the cd command?

    It changes the current working directory.

    Signup and view all the flashcards

    What are File Permissions?

    It protects file contents from unauthorized viewing by controlling access.

    Signup and view all the flashcards

    What is the mkdir command?

    It creates one or more directories or subdirectories.

    Signup and view all the flashcards

    What is the cp command?

    It copies files from one location to another or renames them without changing content.

    Signup and view all the flashcards

    What is the mv command?

    It moves files to a new location or renames them without changing their content.

    Signup and view all the flashcards

    What is the rm command?

    Removes files from the system.

    Signup and view all the flashcards

    What is a Hard Link?

    It creates another file name (hard link) that points to the same data as an existing file. Hard links share the same inode, which includes permissions, ownership, and content.

    Signup and view all the flashcards

    What is a Symbolic Link?

    It creates a symbolic link (soft link) that points to an existing file or directory. Unlike hard links, they can point to files on different file systems and can point to directories.

    Signup and view all the flashcards

    What is Pathname Expansion?

    It allows you to match file and directory names using patterns containing metacharacters.

    Signup and view all the flashcards

    What is Tilde Expansion (~)?

    It expands ~ to the current user's home directory.

    Signup and view all the flashcards

    What is Brace Expansion {}?

    It generates multiple strings based on a defined pattern inside braces {}.

    Signup and view all the flashcards

    What is Variable Expansion?

    It replaces variables with their stored values.

    Signup and view all the flashcards

    What is Command Substitution?

    It replaces a command with its output.

    Signup and view all the flashcards

    How can you protect arguments from expansion?

    It prevents unintended expansion of special characters.

    Signup and view all the flashcards

    What are Manual Pages (man Pages)?

    A built-in form of documentation for Linux commands, files, and concepts.

    Signup and view all the flashcards

    Vim

    It provides a powerful text editor commonly found on Linux and Unix-like systems, often used for editing configuration files.

    Signup and view all the flashcards

    Study Notes

    Linux System Administration

    • Linux is a free and open-source operating system known for its flexibility, security, and collaborative development
    • It powers many devices and systems worldwide, configurable from a full graphical desktop to a small appliance
    • Learning Linux can boost career opportunities and tech skills, useful in internet infrastructure, cloud computing, supercomputers, and mobile apps

    What Makes Linux Great ?

    • Open source: Anyone can view, modify and share the code, leading to rapid innovation and transparency
    • Powerful CLI (command-line interface): Efficient automation and system administration, easy access and powerful scripting.
    • Modular and flexible: Easy customization and upgrades (easily replace or remove components) Components can be upgraded when needed

    Linux Distributions

    • A complete operating system built on the Linux kernel, offering a user-friendly experience with pre-installed software and tools
    • Constructed from a Linux kernel that supports user programs and libraries.
    • Key points about Linux distributions: Open-source construction, pre-packaged convenience, variety of choices catered to different needs, essential characteristics (Linux kernel, user programs, installation and update tools, and vendor/community support)

    Red Hat

    • A leading provider of open-source solutions including Red Hat Enterprise Linux, JBoss middleware, and cloud technologies.
    • Facilitates customers' connection to the open-source community and effective use of open-source software.

    Fedora

    • Community-driven Linux distribution known for fast-paced innovation and cutting-edge features.

    Red Hat Enterprise Linux (RHEL)

    • Commercially supported Linux distribution, leading platform for open source computing.
    • Major releases derived from the CentOS Stream project (derived from Fedora)

    RHEL for Edge

    • An image-based variant of RHEL designed with different deployment mechanism, using Image Builder
    • Efficient, customizable, and suitable for various environments.
    • Secure management, zero-touch provisioning, and system health visibility are important features

    Red Hat CoreOS (RHCOS)

    • Developed from RHEL components, not a stand-alone operating system.
    • Supports cloud-native applications, utilizing the CRI-O compliant container engine

    Red Hat Universal Base Image (UBI)

    • A freely redistributable derivative of RHEL.
    • Serves as a base for cloud-native and web application development within the containers

    Command Line Interface (CLI)

    • A text-based interface for interacting with a computer system using commands
    • The shell is the main program that provides the CLI
    • Red Hat Enterprise Linux uses the Bash shell as default

    Logging In

    • A text-based interface for interacting with the computer system using commands.
    • Locally: Physical Console (keyboard and display), Virtual Consoles (Ctrl+Alt+F1-F6)
    • Remotely: Secure Shell (SSH).
    • Public Key Authentication: Passwordless login using a private (users local machine) and public key (stored on the remote server).

    Logging Out

    • exit command
    • Ctrl+D

    Commands Summary

    • usermod -L user01: Locks password of user01
    • ssh username@remotehost: Logs in to a remote host via SSH
    • ssh -i private_key_file username@remotehost: Logs in via public key authentication
    • chmod 600 private_key_file: Sets file permissions on a private key file
    • exit: Logs out of the current shell session

    Viewing File Contents

    • cat: views entire file contents, concantenates files, or redirects to output.
    • less: displays one page at a time, allowing scrolling.
    • head: displays the first 10 lines by default or a specified amount.
    • tail: displays the last 3 lines by default or a specified amount.
    • wc: counts lines, words, and characters in a file

    Command Syntax

    • Command, options (- or --), arguments separated by spaces
    • Use semicolon (;) to separate multiple commands on a single line

    Examples of Simple Commands

    • date displays date and time.
    • date + %R displays time in 24 hour format
    • date + %x displays date in MM/DD/YYYY format
    • passwd changes user password

    File system hierarchy

    • Linux uses an inverted tree structure for file organization
    • The / character separates directories in file paths

    Locating Files by Name

    • Paths: Specify file system location.
    • Absolute Paths: Start with a / (e.g., /home/user/documents).
    • Relative Paths: Do not start with a / (e.g., documents/file).
    • pwd: displays current directory.
    • ls: lists directory contents. (ls -a displays all files, including hidden files). ls -l gives a detailed listing.

    Directory Purposes

    • /boot : System startup files, like the boot loader and kernel
    • /dev : Special files for hardware interactions (disks, USB drives etc.)
    • /etc : System configuration files
    • /home : Home directories for users
    • /root : The root user's home directory
    • /run: Temporary runtime data for processes
    • /tmp: Temporary storage space for files
    • /var: Files that change often, such as log files and mail
    • /bin : Essential command-line programs
    • /var : Variable data, such as logs, mail, and print queues.
    • /usr : Software applications and utilities.

    Copy Files and Directories (cp)

    • Copies files or directories.
    • cp command by default ignores directories
    • cp -r copies directories and their contents ensuring preserving original names.
    • Overwrites existing files if the destination file already exists
    • multiple files can be copied to a target directory by specifying the target directory as the last argument

    Move Files and Directories (mv)

    • Moves files or directories
    • mv can be used for renaming and moving.

    Remove Files and Directories (rm)

    • Removes files or directories.
    • rm -r is needed for recursively removing directories and contents
    • -i option prompts for confirmation
    • -rf option forces removal without prompting.
    • Create multiple file names that point to the same file. The file names are called links.

    • The file names are called hard or symbolic links

    • Hard links share the same metadata, and any modification to one hard link will affect all the others.

    • Symbolic links are essentially shortcuts, the target file can reside in a different location.

    Command History

    • history: (Displays previously executed commands as a numbered list.)
    • ![number]: Executes the command identified by that number. (e.g., !26 to re-execute the 26th command)
    • !string: Executes the most recent command starting with a particular string

    Editing the Command Line

    • Ctrl+A: Moves to beginning of line.
    • Ctrl+E: Moves to the end of a line.
    • Ctrl+U: Clears text before the cursor
    • Ctrl+K: Clears text after the cursor.
    • Ctrl+LeftArrow: Moves to the beginning of the previous word.
    • Ctrl+RightArrow: Moves to the end of the next word.
    • Ctrl +R: Searches through the command history.

    Tab Completion

    • Pressing Tab once will complete the command or filename as much as possible. Pressing Tab twice lists all the possible completions.

    Man pages

    • A built-in documentation resource for Linux commands, files, and concepts.
    • Using 'man command_name' to display relevant documentation.
    • Man pages are stored in the /usr/share/man directory. The section number in the documentation identifies which page. (e.g. man 5 passwd )

    Managing Local Users and Groups

    • User Management: Create, modify, delete users, including root (superuser)

    • Group Management: Create, modify, delete groups

    • Password Management: Set/change user passwords using the "passwd" command

    • Access Control: Managing file and device permissions, including restricting access and switching between accounts.

    • Switching Users (su, sudo): Switching to other users or the root account.

    Studying That Suits You

    Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

    Quiz Team

    Related Documents

    Description

    Explore the fundamental aspects of Linux System Administration. This quiz covers the benefits of using Linux, its open-source nature, and various distributions that enhance the user experience. Discover how mastering Linux can open up numerous career opportunities in technology.

    More Like This

    Use Quizgecko on...
    Browser
    Browser