Editing Linux/RHEL

From Bibliotheca Anonoma

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 7: Line 7:
* RHEL uses the YUM package manager, and RPMs as package files.
* RHEL uses the YUM package manager, and RPMs as package files.
* RHEL 7 will remain supported as the main version until 2019.
* RHEL 7 will remain supported as the main version until 2019.
* SELinux is used as the primary Mandatory Access Control System. If you don't like SELinux, tough luck, use Debian for AppArmor.
* SELinux is used as the primary Mandatory Access Control System.
* Systemd is used as the primary initscript system.
* Systemd is used as the primary initscript system.


Line 13: Line 13:


# Set up a as admin with sudo and ssh key, as well as any other users. Also set up a password (it's like a PIN, last line of defense against privilege escalation).
# Set up a as admin with sudo and ssh key, as well as any other users. Also set up a password (it's like a PIN, last line of defense against privilege escalation).
#* Do not allow root user login via SSH. If this is enabled, disable it.
#* The private key created by Amazon should only be used in case of emergency by the effective owner (if other admins forget their passphrases or passwords).
#* For AWS, The private key created by Amazon should only be used in case of emergency by the effective owner (if other admins forget their passphrases or passwords).
# Change the hostname to the current one using [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec_Configuring_Host_Names_Using_hostnamectl.html hostnamectl.]
# Change the hostname to the current one using [https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Networking_Guide/sec_Configuring_Host_Names_Using_hostnamectl.html hostnamectl.]
# Set up the [http://www.cyberciti.biz/faq/installing-rhel-epel-repo-on-centos-redhat-7-x/ EPEL repository.]
# Set up the [http://www.cyberciti.biz/faq/installing-rhel-epel-repo-on-centos-redhat-7-x/ EPEL repository.]
# Install Byobu, and enable it for all new users.
# Install Byobu, and enable it for all new users.
# Set up [https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7 Nginx] and also [https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-on-centos-7 Server Blocks] to make things easier.
# Set up [https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-centos-7 Nginx] and also [https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-on-centos-7 Server Blocks] to make things easier.
== Hardening ==
# First, make sure to disable password authentication and use an SSH key to log in. Since SSH keys authenticate with asymmetric encryption, they cannot be brute forced by an attacker.
# Next, change the SSH port from 22 and make sure to register this change with SELinux. Although all this does is hide the login port, it goes a long way to stopping automated SSH bots which try the basic ports and then leave.
=== Tools worth Using ===
* [[SELinux]] - Mandatory Access Control, to stop exploits by preventing applications from exhibiting unauthorized behavior, even if they have root access.
** Notice that OpenVZ cannot use SELinux: it would be ineffective anyway. The Host kernel has to handle Mandatory Access Control for all containers, and Proxmox OpenVZ does this with AppArmor. If this is not acceptable, use KVM instead.
* [[Fail2Ban]] - Looks out for malicious or excessive SSH login attempts and then bans them.
* Smart - Check the health of your drives and notify the admin by email or whatever if they are bad.
* Logwatch - Send the admin a digest of what's happened daily.
---
* [https://highon.coffee/blog/security-harden-centos-7/ Good Hardening Guide] - Good practices and tools to use.
* [http://stealingthe.network/centos-7-server-hardening-guide/]
* [https://www.tecmint.com/security-and-hardening-centos-7-guide/ Part 1: Basic Bare Metal Security] - Fix the gaping holes in security in hardware and system setup before moving on to the software fixes.
* [https://www.tecmint.com/centos-7-hardening-and-security-guide/ Part 2: Advanced Software Security] - Software level methods to harden CentOS


== RHEL ==
== RHEL ==
Please note that all contributions to Bibliotheca Anonoma are considered to be released under the Creative Commons Attribution-ShareAlike (see Bibliotheca Anonoma:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)

Template used on this page: