Category Archives: LFCS

Firewalld and iptables commands

i) firewall-cmd (iptables): yum install  firewalld  firewall-config systemctl status|start|stop|enable|disable firewalld firewall-cmd –state firewall-cmd –reload firewall-cmd –list-all | –list-ports firewall-cmd –panic-on |–panic-off    (Block all incoming or outgoing traffic) zones: firewall-cmd  –get-zones|–get-default-zone|–get-active-zone firewall-cmd  –set-default-zone=trusted  [–permanent]  services: firewall-cmd –list-services firewall-cmd –add-service=ftp         [–permanent]  [–zone=public] … Continue reading

Posted in LFCE, LFCS, Linux

Setup NFS and Samba servers in Linux

i) NFS server setup: yum install nfs-utils Create a shared directory and assign appropriate permission: mkdir   -m 777 /nfs   (All users have read,write and execute access) chown  nfsnobody:nfsnobody  /nfs Enter the following into /etc/exports: /nfs   192.168.254.132/24(rw)   192.168.254.0/24(ro) Restart and enable nfs and … Continue reading

Posted in LFCE, LFCS

Setup Squid proxy server in Linux

Squid: Allow access for a local network: yum install squid Add the following in /etc/squid/squid.conf after: # INSERT YOUR OWN RULE(S) HERE acl mynetwork src 192.168.254.0/24 http_access allow mynetwork #http_access allow localnet       (Comment it because it contains 192.168.0.0) squid -k … Continue reading

Posted in LFCE, LFCS, Linux

Setup NTP and Chrony

ntp: yum install ntp Un-comment or add the following lines in /etc/ntp.conf server 0.centos.pool.ntp.org iburst server 1.centos.pool.ntp.org iburst server 2.centos.pool.ntp.org iburst server 3.centos.pool.ntp.org iburst restrict 192.168.254.0 netmask 255.255.255.0 nomodify notrap systemctl start ntpd; systemctl enable ntpd firewall-cmd –add-service=ntp –permanent; firewall-cmd … Continue reading

Posted in LFCE, LFCS

Setup FTP server in Linux

Allow FTP upload for anonymous users: Install FTP server/client and allow it in firewall: yum  install  vsftpd  ftp                 (vsftpd-> server; ftp-> client) systemctl  enable  vsftpd firewall-cmd –add-service=ftp –permanent firewall-cmd –reload Update the following parameters in /etc/vsftpd/vsftpd.conf: … Continue reading

Posted in LFCE, LFCS, Linux | Tagged ,

Setup Postfix and Dovecot in CentOS7

i) Install Postfix: yum install postfix postconf   inet_interfaces=all                           (Listen on all configured interfacesIPs) postconf   mynetworks_style=subnet             (Enable by default trusted subnet) systemctl restart postfix; systemctl enable postfix Allow smtp … Continue reading

Posted in LFCE, LFCS, Linux | Tagged

Configure Apache in Linux

i) Install Apache server Install Apache server: yum install  httpd systemctl enable httpd         systemctl start httpd             Allow Apache traffic in firewall: firewall-cmd –add-service http –permanent firewall-cmd –reload Configs: /etc/httpd/conf/httpd.conf /etc/httpd/conf.d/ssl.conf Logs: /var/log/httpd/accesss_log /var/log/httpd/error_log … Continue reading

Posted in LFCE, LFCS | Tagged ,