Catalog / Remote & Network Command-Line Cheatsheet
Remote & Network Command-Line Cheatsheet
A comprehensive cheat sheet for remote access, network diagnostics, and management commands in the command-line interface. This guide provides quick references and examples for common tasks.
Basic Network Information
Network Configuration
|
Displays network interface configurations including IP addresses, MAC addresses, and status. |
|
Shows the kernel’s IP routing table. |
|
Displays network routing information, including the destination network, gateway, and interface. |
|
Displays the system’s hostname. |
|
Displays all IP addresses of the host. |
|
Show current DNS configuration. (systemd-resolved required) |
DNS Lookup
|
Queries DNS servers to find the IP address associated with a domain. |
|
A more advanced DNS lookup utility, providing detailed DNS record information. |
|
Performs DNS lookups to find the IP address of a domain. |
|
Resolve domain name to IP addresses and vice versa using systemd-resolved. |
|
Check what DNS server is used. |
Remote Access and File Transfer
Secure Shell (SSH)
|
Connects to a remote host via SSH. |
|
Connects to a remote host using a specific port. |
|
Copies your public key to the remote host for passwordless login. |
|
Creates a local port forwarding via SSH. |
|
Creates a remote port forwarding via SSH. |
Secure Copy (SCP)
|
Copies a file to a remote host. |
|
Copies a file from a remote host. |
|
Copies a directory recursively to a remote host. |
|
Copies a file to a remote host using a specific port. |
rsync
|
Synchronizes files/directories between two locations (local or remote). |
|
Synchronizes files/directories to a remote host. |
|
Synchronizes files/directories from a remote host. |
Network Diagnostics
Ping
|
Tests network connectivity by sending ICMP echo requests to a host. |
|
Sends a specific number of ping requests. |
|
Specifies the interval between ping requests in seconds. |
|
Sets the size of the ping packet. |
Traceroute
|
Traces the route packets take to a destination host. |
|
Sets the maximum number of hops to search for the destination. |
|
Prints hop addresses numerically rather than symbolically. |
netcat (nc)
|
Performs a port scan to check if a port is open. -z: zero-I/O mode, -v: verbose. |
|
Listen on a specified port for incoming connections. |
|
Connect to a specified port on a remote host. |
Network Management
Network Interface Management
|
Brings up a network interface. |
|
Brings down a network interface. |
|
Assigns an IP address to a network interface. |
|
Removes an IP address from a network interface. |
Firewall Management (iptables)
|
Lists the current iptables rules. |
|
Allows incoming TCP traffic on a specific port. |
|
Blocks incoming TCP traffic on a specific port. |
|
Flushes all existing iptables rules (use with caution). |
Firewall Management (firewalld)
|
Check if firewalld is running. |
|
Lists all settings of the default zone. |
|
Opens a port permanently in the public zone. |
|
Reloads firewalld to apply changes. |