Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Distributions»CentOS»CentOS 8 – Initial Server Setup

    CentOS 8 – Initial Server Setup

    RahulBy RahulJanuary 6, 20203 Mins ReadUpdated:March 6, 2020

    Use this tutorial to configure your CentOS 8 Linux machine for the first time. For example, you have launched a new VPS or dedicated host with CentOS 8, Follow the below steps to complete the initial server setup with CentOS 8.

    CentOS 8 Initial Server Setup

    Step 1 – Login to CentOS 8

    Login to your CentOS 8 Linux machine. The desktop users can use the GUI interface to log in. Remote users connect to there server using SSH access.

    ssh [email protected]_server_ip
    

    Step 2 – Update Current Pacakges

    After login, first, update all the current packages on your system.

    dnf clean all
    dnf update
    

    Step 3 – Install Required Packages

    dnf install vim wget
    

    Step 4 – Create User Account

    Some of the cloud hosting providers like DigitalOcean provider root access only. This is the best practice to create a separate account for the system administrator works.

    Use the following command to create user:

    adduser rahul
    

    Then set a strong password to the newly created account.

    passwd rahul
    

    You will need Sudo privileges to work with system admin tasks. The CentOS Linux systems have a default group named “wheel” with Sudo privileges. Add your newly created user to the wheel group.

    usermod -aG wheel rahul
    

    Step 5 – Setup Basic Firewall

    If your CentOS 8 default installation does not have a firewall installed, follow the below steps to setup a firewall on your CentOS 8.

    dnf install firewalld
    

    After installation, start firewall service and enable it to auto-start on system boot.

    systemctl start firewalld
    systemctl enable firewalld
    

    By default firewall allowed SSH access to remote users. You may also need to allow other services through the firewall to remote users.

    You can directly provide a service name like “http” or “https” to allow. The firewalld uses /etc/services file to determine the corresponding port of the service.

    firewall-cmd --permanent --add-service=http
    firewall-cmd --permanent --add-service=https
    

    If the service name is not defined in /etc/services, add allow access by port number directly. For example to allow TCP port 8080 or 10000 (default Webmin) to your firewall.

    firewall-cmd --permanent --add-port=8080/tcp
    firewall-cmd --permanent --add-port=10000/tcp
    

    After making any changes to your firewall, make sure to reload changes using the following command.

    firewall-cmd --reload
    

    To view, all the allowed port and services use the following command.

    firewall-cmd --permanent --list-all
    

    Output:

    public
      target: default
      icmp-block-inversion: no
      interfaces:
      sources:
      services: cockpit dhcpv6-client http https ssh
      ports: 8080/tcp 10000/tcp
      protocols:
      masquerade: no
      forward-ports:
      source-ports:
      icmp-blocks:
      rich rules:
    

    Conclusion

    Your CentOS 8 system is ready for use. Thank You.

    CentOS 8 Initial Server Setup
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Mono on Debian 10/9
    Next Article How to Preserve Directory Path with CP Command

    Related Posts

    Initial Server Setup with Debian 11

    4 Mins Read

    How To Install Security Updates on CentOS 8 (Manual + Automatic)

    4 Mins Read

    Initial Server Setup with Debian 10/9/8

    Updated:June 25, 20214 Mins Read

    How to Install PHP 8 on CentOS/RHEL 8

    3 Mins Read

    How to Install Python 3.9 on CentOS/RHEL 8

    Updated:July 17, 20213 Mins Read

    How to Install Let’s Encrypt (Certbot) on CentOS 8

    Updated:September 11, 20203 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.