Dec 21

CentOS (Let’s Make A Server!)

Tags:

passwd

adduser

Watch It!

passed user

visudo

Add to the bottom:

<username> ALL=(ALL) ALL

sudo ls -al

scp from local computer

scp ~/.ssh/id_rsa.pub [email protected]:/home/demo/

su user

cd ~

mkdir .ssh

cat id_rsa.pub >> ~/.ssh/authorized_keys

chmod 700 ~/.ssh

chmod 600 ~/.ssh/*

user’s ~/.bash_profile <add PS1=”: -==x==x=(0)=x==x==- : “>

cd ~

nano .bash_profile

sudo iptables -L

sudo iptables -I INPUT -m tcp -p tcp –dport http -j ACCEPT

sudo iptables -I INPUT -m tcp -p tcp –dport https -j ACCEPT

sudo iptables -I INPUT -m tcp -p tcp –dport ssh -j ACCEPT

sudo iptables -I INPUT -m tcp -p tcp –dport ftp -j ACCEPT

sudo iptables -I INPUT -m tcp -p tcp –dport ftp-data -j ACCEPT

sudo iptables -I INPUT -m tcp -p tcp –dport mysql -j ACCEPT

sudo iptables -L

sudo service iptables save

sudo service iptables restart

sudo iptables -L

sudo yum update

sudo yum install vsftpd httpd mod_ssl crypto-utils

sudo yum install php php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mhash php-mysql php-xml php-mbstring

sudo nano /etc/sysconfig/network

HOSTNAME=fsdn.domain.com

sudo nano /etc/hosts

<ip.ip.ip.ip> fsdn.domain.com

<127.0.0.1> fsdn.domain.com

<ip6 address> fsdn.domain.com

sudo shutdown -r now

hostname -f

wget <insert download url to iRedMail>

su root

mv iRedMail ~/

tar xjf iRedMail

cd iRedMail

bash iRedMail.sh

<make sure you make the correct DNS entries for MX – mail.domain.com and domain.com>

Using previously installed crypto-utils:

genkey server

get a valid key / crt / pem file

for https — put it in the /etc/httpd/conf.d/ssl.conf

for mail — put it in /etc/dovecot/dovecot.conf & /etc/dovecot/conf.d/10-ssl.conf

remember to ‘!include_try /etc/dovecot/dovecot-private.conf’

where ‘ssl_key_password = secretpassword’

 

—————————————–

Always remember… WHAT IF AND WHY NOT?!?