Skip to content

Instantly share code, notes, and snippets.

@Auronmatrix
Last active July 15, 2019 15:36
Show Gist options
  • Save Auronmatrix/5f296fcf6bb0db510d1589226c5fa3b3 to your computer and use it in GitHub Desktop.
Save Auronmatrix/5f296fcf6bb0db510d1589226c5fa3b3 to your computer and use it in GitHub Desktop.
Setup CentOS 7

Articles:

Steps taken from following guides:

Download ISO

Install:

  • Use the wizard

Network:

  • $ nmcli d # check interface status
  • $ nmtui # Open network manager. Edit your connection and make sure dhcp enable and "auto connect" selected
  • $ nmtui-hostname # configure hostname
  • $ ifconfig # check if dhcp works
  • $ ip a
  • $ ping -c2 google.com

OS

  • $ yum check-update
  • $ yum upgrade

Utils:

  • $ yum install nano wget curl net-tools lsof bash-completion

Services:

  • $ systemctl list-unit-files -t service

Remove Postfix (mailserver)

  • $ systemctl stop postfix
  • $ systemctl disable postfix
  • $ yum remove postfix

SSH:

Ensure you have a non-root admin user configured and added to the wheel group (if you did not create if with the wizard)

  • $ adduser <user>
  • $ passwd <user-pass>
  • $ usermod -aG wheel <user>

On your local machine, copy your ssh pubkey to the server

  • $ ssh-copy-id <user>@SSH_SERVER_IP
  • Test passwordless login with $ ssh <user>@SSH_SERVER_IP

Disable root login with ssh

  • $ nano /etc/ssh/sshd_config
  • set PermitRootLogin no
  • $ systemctl restart sshd
  • Test root ssh disabled $ ssh root@SSH_SERVER_IP

FIREWALL:

  • $ yum install firewalld
  • $ systemctl start firewalld
  • $ firewall-cmd --permanent --add-service=ssh

DATE/TIME:

  • $ timedatectl list-timezones
  • $ timedatectl set-timezone region/timezone # timedatectl set-timezone Europe/Berlin
  • $ timedatectl # test to see if timezone correct

NTP:

  • $ yum install ntp
  • $ systemctl start ntpd
  • $ systemctl enable ntpd

DOCKER and COMPOSE:

Follow https://github.com/NaturalHistoryMuseum/scratchpads2/wiki/Install-Docker-and-Docker-Compose-(Centos-7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment