Search The Hostwinds Guides Knowledge Base

Getting Started With CentOS 7

This article is intended for Hostwinds clients who have chosen to install CentOS 7 to begin configuring and customizing  server using the command line interface. We highly recommend taking a snapshot backup before making any modifications in case you need to restore it at any time. Below are some basic configurations you can view and configure to fit your needs. This article is meant to offer our Unmanaged clients with some basic commands and information to help you get started with a clean install of CentOS 7 on your Instance.

Any commands that are preceded with a #  is suggeseted to be using  root  user access. Commands preceded with a $  indicate that a regular user can perform these tasks.

 

Basic System Configuration

Date and Time

Displaying Current Date and Time using one of the following commands

Changing Local Time

Change [time_zone]  to the time zone you prefer to use for your local time from an option on the list-timezones  results

System Locale

List all available locales

Show current locale setting

Set or change system locale

Replace [locale]  above with the locale setting of your choice

Manage Software using Yum

List all enabled repositories

Search for a package using yum

Replace [string]  above with what you are searching for

Install a package

Replace [package_name]  above with the package name

Update all packages and their dependencies

Enable a service on boot 

Disable a service on boot

Replace [service]  with the name of the service.

Install ConfigServer Security & Firewall (CSF) or Firewalld

Install CSF

If you decide to use CSF instead of firewalld, here are the installation instructions:

Enable csf and lfd using your favorite text editor so that it can be started and taken out of testing. Just open the /etc/csf/csf.conf  file and replace TESTING = "1"  with  TESTING = "0" and save this file.

Next, start csf:

Now, enable csf and lfd to begin on startup:

You can then configure csf and lfd by reading the documentation and configuration files in /etc/csf/csf.conf  and /etc/csf/readme.txt  directly or through the csf User Interface.

Install Firewalld

If you prefer to use firewalld with SELinux and not csf, the instructions are below:

Start Firewalld and begin on system startup

Enable SELinux

To set SELinux to permanently enforcing so that SELinux polices are enforced, modify the /etc/selinux/config  configuration file using your favorite text editor and set this to enforcing as seen below and save these changes.

selinux enforcing

Generate SSH Keys

If you have not already generated a key when creating your instance, of if you would like to add another key pair, you can do so with the help of the guide to Create a Strong SSH Key in Linux 

Manage User Accounts

Create a new user

Use useradd --help  to see the options to replace in [options]  above and also replace [user_name]  with the username you would like to create.

Assign a password to a user

Replace [user_name]  above with the username.

Add a User to a Group

Replace [group_name]  with the group name you want to assign the user to and the [user_name]  with the desired user name you would like to assign to a group.

If you are having any trouble with our Managed Services, or have any questions, please let us know so that we can help you. 

Related Articles

Related Resources