Create New Post

Basic system configuration tasks such as setting

Basic system configuration tasks in CentOS typically involve setting up hostname, configuring network settings, managing users, and performing basic system maintenance. Here's how you can perform these tasks:

1. Setting Hostname:

  • Open a terminal or connect to your CentOS system via SSH.
  • Use the hostnamectl command to set the hostname:
    sudo hostnamectl set-hostname yourhostname
     
  • Replace yourhostname with the desired hostname for your system.
  • Optionally, you can edit the /etc/hostname file directly and add your hostname there.

2. Configuring Network Settings:

  • Network settings in CentOS are typically configured using the nmcli or nmtui commands.
  • Use nmcli to manage network connections from the command line:
    
     

    sudo nmcli connection modify <connection-name> ipv4.addresses <IP-address>
    sudo nmcli connection modify <connection-name> ipv4.gateway <gateway-IP>
    sudo nmcli connection modify <connection-name> ipv4.dns <DNS-server-IP>
    sudo nmcli connection up <connection-name>

  • Replace <connection-name> with the name of your network connection (e.g., eth0, ens33).
  • Replace <IP-address>, <gateway-IP>, and <DNS-server-IP> with your desired IP address, gateway, and DNS server IP addresses, respectively.

3. Managing Users:

  • Use the useradd command to add a new user:
    sudo useradd -m username
    
  • Replace username with the desired username.
  • Set a password for the new user using the passwd command:
    sudo passwd username
    
  • Provide a password when prompted.
  • Optionally, you can add the new user to specific groups using the usermod command.

4. Basic System Maintenance:

  • Update package repositories and install available updates:
     sudo yum update
    
  • Install additional software packages as needed using the yum install command.
  • Monitor system resources using tools like top, htop, or sar.
  • Manage system services using commands like systemctl start, systemctl stop, and systemctl enable.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

69676