Skip to content

2. Installation & Remote Connection

2.1 Installing Linux in a Virtual Machine

For beginners, the safest way to learn is to install Linux in a Virtual Machine, without affecting your existing system.

Recommended Tools:

  • VirtualBox: free, open source, cross-platform, great for beginners
  • VMware Workstation Player: free for personal use, better performance
  • WSL2: Windows Subsystem for Linux, suitable for lightweight use (Windows 10/11)

Installation Steps Overview (using VirtualBox + Ubuntu as an example):

  1. Download VirtualBox: https://www.virtualbox.org/
  2. Download the Ubuntu ISO image: https://ubuntu.com/download/desktop
  3. Create a new virtual machine in VirtualBox, allocate at least 2GB RAM and 20GB disk
  4. Mount the ISO image and start the installation
  5. Follow the wizard to set up username, password, timezone, etc.

💡 Tip: 💡 WSL2 quick setup: Run wsl --install -d Ubuntu in PowerShell for a one-click installation.

2.2 SSH Remote Connection

In practice, Linux servers usually don't have a graphical interface, so you need to connect remotely via SSH (Secure Shell).

Connecting from Windows:

  • Windows 10/11 comes with a built-in SSH client, use it directly in CMD/PowerShell
  • Or use tools like PuTTY, MobaXterm, Termius, etc.

Basic Connection Commands:

bash
# Basic SSH connection
ssh username@192.168.1.100

# Specify port (default is 22)
ssh -p 2222 username@192.168.1.100

# Use key-based login (more secure)
ssh -i ~/.ssh/id_rsa username@192.168.1.100
bash
The authenticity of host '192.168.1.100 (192.168.1.100)' can't be established.
ED25519 key fingerprint is SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.1.100' (ED25519) to the list of known hosts.
username@192.168.1.100's password:
Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-91-generic x86_64)

Last login: Sat Jun 20 10:30:45 2026 from 192.168.1.50
username@server:~$

Generating an SSH Key Pair:

bash
ssh-keygen -t ed25519 -C "your_email@example.com"
bash
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/user/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_ed25519
Your public key has been saved in /home/user/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:AbCdEfGhIjKlMnOpQrStUvWxYz1234567890abcde your_email@example.com

Copying the Public Key to the Server:

bash
ssh-copy-id username@192.168.1.100

2.3 Terminal Basics

The Terminal is your window for communicating with Linux. After opening a terminal, you'll see a Prompt:

bash
username@hostname:~$

This prompt contains the following information:

  • username: the currently logged-in user
  • @hostname: the hostname
  • ~: the current directory (~ represents the home directory)
  • $: regular user prompt (# indicates the root user)

⚠️ Note: ⚠️ Important: Linux commands are case-sensitive! File and file are completely different things.

Five Ways to Get Help:

bash
# Method 1: man pages (most detailed)
man ls

# Method 2: --help flag (quick reference)
ls --help

# Method 3: info docs (GNU style)
info ls

# Method 4: whatis one-line description
whatis ls

# Method 5: apropos search for related commands
apropos "list directory"
bash
$ whatis ls
ls (1)               - list directory contents

$ apropos "list directory"
dir (1)              - list directory contents
ls (1)               - list directory contents
vdir (1)             - list directory contents