Learning Linux Fundamentals with SSH

Oct 25, 2024

TryHackMe: Linux Fundamentals Part 2

Overview

  • Instructor: John
  • Platform: TryHackMe
  • Focus: SSH, commands, file system interactions

Task 1: Introduction

  • Recommends completing Linux Fundamentals Part 1
  • Skills covered:
    • SSH login to Linux machines
    • Using flags and arguments in commands
    • File system interactions: copying, moving files
    • File and folder access mechanisms
    • Running scripts and executables

Task 2: Accessing Your Linux Machine Using SSH

  • SSH (Secure Shell): Protocol to securely connect to a remote machine
  • Encrypted communication between devices
  • Deploying Machines:
    • Start your Linux machine and TryHackMe attack box
    • Machines have a 2-hour lifespan (extendable)
  • SSH Command Format:
    • ssh <username>@<ip-address>
    • Example: ssh tryhackme@<ip-address>

Task 3: Introduction to Flags and Switches

  • Command Arguments: Modify command behavior
  • LS Command: Lists directory contents
    • -a: Show hidden files
  • Help Options:
    • --help for command options and usage
    • Man pages (man <command>) for detailed documentation

Task 4: File System Interaction Continued

Creating Files and Folders

  • Touch Command: Create files
    • Example: touch <filename>
  • Mkdir Command: Create directories
    • Example: mkdir <directoryname>

Removing Files and Folders

  • RM Command: Remove files
    • -r: Recursive removal for directories

Copying and Moving Files

  • CP Command: Copy files
    • Example: cp <source> <destination>
  • MV Command: Move/rename files
    • Example: mv <source> <destination>

Determining File Type

  • File Command: Identify file type without extensions
    • Example: file <filename>

Task 5: Permissions 101

  • File Permissions Structure:
    • rwx: Read, write, execute for owner, group, others
    • Format: -rw-r--r--
  • Switching Users:
    • su <username> to switch users
    • -l switch simulates full login
  • Permissions Context: Important for system security

Task 6: Common Directories

  • /etc (Etsy): Configuration files, including sudoers
  • /var (Variable): Frequently accessed data, log files
  • /root: Home directory for root user
  • /tmp (Temporary): Volatile data, useful for testing

Task 7: Conclusion and Summary

  • Summary of topics covered:
    • SSH usage
    • Commands with flags
    • File system management
    • Understanding permissions
    • Navigating key directories
  • Encouragement to review and practice

Task 8: Linux Fundamentals Part 3

  • Instructions to terminate the Linux machine
  • Suggestion: Continue to Part 3 for further learning

Additional Tips

  • Regularly take notes to reinforce learning
  • Familiarize yourself with command syntax and man pages