Accessing the Ubuntu Terminal
Before diving into commands, you need to access the Ubuntu terminal. The method depends on your setup and how you’re connecting to Ubuntu. Here are the most common scenarios:
Scenario 1: Local Ubuntu Desktop (Graphical Interface)
If you’re using Ubuntu with a desktop environment (like GNOME, KDE, or XFCE), you have several ways to access the terminal:
Method 1: Keyboard Shortcut (Fastest)
# Press simultaneously:
Ctrl + Alt + T
This opens a new terminal window instantly – the quickest way for power users.
Method 2: Application Launcher
- Click the “Show Applications” button (9-dot grid) in the bottom-left corner
- Type “terminal” in the search box
- Click on “Terminal” application
- Or navigate to Activities → Terminal
Method 3: Right-Click Context Menu
- Open the file manager (Nautilus)
- Navigate to any folder
- Right-click in empty space
- Select “Open in Terminal”
- This opens terminal directly in that folder’s location
Method 4: Alt+F2 Run Dialog
- Press Alt + F2
- Type “gnome-terminal” or “terminal”
- Press Enter
Scenario 2: SSH Connection to Remote Ubuntu Server
When your Ubuntu system is a remote server (cloud instance, VPS, or local server), you’ll connect via SSH:
From Windows Client:
Using Built-in OpenSSH (Windows 10/11):
# Open Command Prompt or PowerShell
ssh username@server-ip-address
# Examples:
ssh [email protected] # Local server
ssh [email protected] # Cloud server (AWS/DigitalOcean/Dash arabia)
ssh [email protected] # Using domain name
Using PuTTY (Alternative Windows SSH client):
- Download and install PuTTY
- Open PuTTY application
- Enter server IP address in “Host Name” field
- Set port to 22 (default SSH port)
- Click “Open”
- Enter username and password when prompted
From macOS/Linux Client:
# Open Terminal application
ssh username@server-ip-address
# With specific port (if not default 22):
ssh -p 2222 username@server-ip-address
# Using SSH key authentication:
ssh -i ~/.ssh/private-key.pem username@server-ip-address
Scenario 3: Virtual Machines and Containers
VirtualBox/VMware Ubuntu VM:
- Start the virtual machine
- Wait for Ubuntu to boot
- Login to desktop or server interface
- Use any of the desktop methods above (if GUI installed)
- Or use direct console if server version
Docker Container with Ubuntu:
# Run interactive Ubuntu container:
docker run -it ubuntu:latest /bin/bash
# Connect to running Ubuntu container:
docker exec -it container-name /bin/bash
Windows Subsystem for Linux (WSL):
# Open from Windows:
wsl # Default distribution
wsl -d Ubuntu-20.04 # Specific Ubuntu version
ubuntu # Direct Ubuntu command
# Or search “Ubuntu” in Start Menu and click the app
SSH Connection Best Practices
Setting Up SSH Key Authentication:
# Generate SSH key pair (on client machine):
ssh-keygen -t rsa -b 4096 -C “[email protected]”
# Copy public key to server:
ssh-copy-id username@server-ip-address
# Or manually add to server’s ~/.ssh/authorized_keys file
SSH Configuration File (~/.ssh/config):
# Create SSH config for easy connections:
Host myserver
HostName 192.168.1.100
User john
Port 22
IdentityFile ~/.ssh/private-key
# Now connect simply with:
ssh myserver
Troubleshooting Terminal Access
Common SSH Connection Issues:
# Permission denied error:
chmod 600 ~/.ssh/private-key # Fix key permissions
# Connection timeout:
ssh -v username@server-ip # Verbose output for debugging
# Wrong port:
ssh -p 2222 username@server-ip # Specify custom port
Desktop Terminal Issues:
- Terminal won’t open: Try Alt + F2, then type xterm or gnome-terminal
- Shortcut not working: Check system settings → Keyboard shortcuts
- Permission issues: Make sure your user is in the correct groups

