Linux Server Basics: From Installation to Network Configuration
This article introduces the basics of Linux servers, covering core steps and key skills. Linux servers, based on open - source systems, are suitable for stable service scenarios (such as those adopted by Alibaba Cloud). For beginners, it is recommended to use Ubuntu Server (user - friendly for novices), CentOS Stream (enterprise - level), and Debian (for basic learning). When installing, virtual machines (VMware/VirtualBox) are preferred, and ISO images and resources of 2 cores, 4G memory, and 40G storage are required. Taking Ubuntu as an example, during virtual machine installation, a username and password need to be set, and automatic partitioning should be used. The core of the system is the command - line interface. Basic commands such as `ls` (list files), `cd` (change directory), and `sudo` (elevate privileges) are commonly used. For network configuration, a static IP needs to be set (CentOS modifies the network card file, while Ubuntu uses Netplan), and ports 80 and 22 should be opened. After installing the SSH service (sshd for CentOS and ssh for Ubuntu), remote connections can be made using Xshell on Windows, or directly via the `ssh` command on Linux/macOS. Key steps include: choosing a distribution → installing in a virtual machine → basic commands → network configuration → SSH connection. Beginners are advised to further study permission management, deploying services such as Nginx, and system monitoring tools. For issues, they can refer to the `man` manual or official documentation.
Read MoreLinux Network Configuration: IP Address and Subnet Mask Setup
Configuring IP addresses and subnet masks on Linux servers is fundamental for network communication. An IP address (32-bit binary, dotted decimal format) identifies a device, while a subnet mask (32-bit, with 1s indicating network portions and 0s indicating host portions) distinguishes between network and host segments. To view current configurations, use `ip addr` (recommended for modern systems) or `ifconfig` (traditional, requiring `net-tools` installation on some systems). Temporary settings can be applied with `ip addr add <IP>/<mask_prefix> dev <interface>` or `ifconfig <interface> <IP> netmask <mask>`, which only persist during the current session. For permanent configuration, distributions vary: CentOS/RHEL 7+ requires editing `/etc/sysconfig/network-scripts/ifcfg-<interface>` and setting `BOOTPROTO=static` with IP/subnet parameters. Ubuntu 18.04+ uses `netplan`, editing `/etc/netplan/*.yaml` to disable DHCP and applying changes with `netplan apply`. Verification is done via `ip addr` to confirm the assigned IP, or by pinging local devices, same-subnet hosts, and the gateway. Key considerations: ensure unique IPs, correct subnet mask alignment, verify interface names (via `ip addr`), and use root/administrator privileges.
Read MoreEssential for Beginners: Basics of Linux Network Configuration
This article introduces the necessity and practical methods of Linux network configuration. For newcomers, mastering network configuration is fundamental for using servers and setting up services. They need to first understand four key elements: IP address (the "ID" of a device), subnet mask (network segment identifier), gateway (entrance/exit between internal and external networks), and DNS (domain name translation). Common commands to check network status include: `ip addr` to view IP addresses, `route -n` to check routes, and `ping` to test connectivity (including local loopback and external network verification). For dynamic IP configuration (DHCP), use the `nmcli` tool to modify connection parameters and activate them. For static IP configuration, prepare parameters such as IP, subnet mask, gateway, and DNS in advance. On CentOS, set static IPs in the `/etc/sysconfig/network-scripts/ifcfg-eth0` file, while Ubuntu uses `netplan` to configure the `01-netcfg.yaml` file. After configuration, verification steps include: using `ip addr` to confirm the IP, `ping` to test local/gateway/external network connectivity, and `nslookup` to test DNS. Common issues like IP conflicts or failure to ping the gateway can be troubleshooted by following the steps: "check IP → verify routes → ping tests". The core lies in understanding the four key elements and practicing commands like `ip` and `ping` regularly.
Read More