Category Archives: Linux

tmux and screen basic commands

tmux: tmux | tmux new -s “mysession”          (Start a new session) tmux ls                       (List sessions) ctrl+b d | exit            (Detach or … Continue reading

Posted in LFCE, LFCS, Linux, Other

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 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 route between two hosts

i) centos host:  (IP: 10.20.45.1; Netmask: 255.255.255.0; Gateway: 10.20.45.1) Add the following into /etc/sysconfig/network-scripts/ifcfg-ens33 NAME=ens33                               DEVICE=ens33 BOOTPROTO=static ONBOOT=yes IPADDR=10.20.45.1 NETMASK=255.255.255.0   (No GATEWAY here because its defined in … Continue reading

Posted in Linux, Other

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 DNS server in linux

Configure a Caching DNS: yum install bind /etc/named.conf listen-on port 53 { any; }; | { 127.0.0.1; 192.168.0.18}; allow-query { any; };         | { localhost; 192.168.0.0/24; }; systemctl restart named dig @localhost|@hostname google.com Configure Authoritative forward zone: Append following … Continue reading

Posted in LFCE, LFCS, Linux