Skip to content
whey edited this page Mar 23, 2012 · 18 revisions

New Server Setup

##Base configuration cheat sheet. This is meant for educational purposes and should not be used to deploy in a commercial environment. This information here is collective and is based on personal knowledge as well as knowledge gathered from various open sources.

With CentOS 6

These controls are in regards to CentOS 6.

Base Configuration

Add new user/group

Create a group and set its configurations

  • 1 open visudo
sudo /usr/sbin/visudo
  • 2 create the group and set its privileges

note: this setting below is strongly suggested for sudo users only as it gives all privileges to the username and access to superuser.

## Allows people in groupname to run all commands
%groupname  ALL=(ALL)       ALL

Adding the user and setting it to a group

/usr/sbin/adduser username
passwd username
/usr/sbin/usermod -a -G groupname username

SSH config

nano /etc/ssh/sshd_config

Configurating iptables

Allows you to configure and save iptables.

nano /etc/iptables.up.rules
/sbin/iptables -F
/sbin/iptables-restore < /etc/iptables.up.rules
/sbin/service iptables save

Auto logout of SSH after x amount of time

  • 1
    # vi /etc/profile.d/autologout.sh
  • 2
TMOUT=300
readonly TMOUT
export TMOUT
  • 3
    chmod +x /etc/profile.d/autologout.sh
  • 4
    service sshd restart

Clone this wiki locally