Aug 17, 2017 | Linux Shell Scripting, Ubuntu 12.04 Server Management
Save current iptables settings using command iptables-save. We save it to /etc/network/iptables.v4.rules iptables-save > /etc/network/iptables.v4.rules Last we configure our box to restore it upon booting up the network interface. Configure your network interface file /etc/network/interfaces nano /etc/network/interfaces #under iface eth0 inet static .... pre-up iptables-restore < /etc/network/iptables.v4.rules tadaaa! short and...
Jun 26, 2015 | Linux Shell Scripting
Root access or sudo rights is required to perform this. #crontab manpage crontab [ -u user ] { -l | -r [ -i ] | -e } #Example for editing crontab for user "anotheruser" sudo crontab -u anotheruser -e #Example for listing crontab for user "anotheruser" sudo crontab -u anotheruser...
Mar 19, 2015 | Linux Shell Scripting, Ubuntu 12.04 Server Management
List the rules for a specific chain. Example below list the “fail2ban-ssh-ddos” chain. iptables -L fail2ban-ssh-ddos --line-numbers Example output: Chain fail2ban-ssh-ddos (2 references) num target prot opt source destination 1 REJECT all -- 192.0.0.8 anywhere reject-with icmp-port-unreachable 2 RETURN all -- anywhere anywhere Delete rule line number 1: iptables -D fail2ban-ssh-ddos...
Jan 13, 2014 | Linux Shell Scripting, Ubuntu 12.04 Server Management
Guide wrote on 13 Jan 2014 Step 1) Install Pure-FTPd using aptitude package tool root@server:~# aptitude -y install pure-ftpd Step 2) Run pure-ftpd as a daemon (background process) root@server:~# echo "yes" > /etc/pure-ftpd/conf/Daemonize Step 3) Disable anonymous ftp login root@server:~# echo "yes" > /etc/pure-ftpd/conf/NoAnonymous Step 4) Jail all local user to their home directories root@server:~# echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone Step 5) Configure FTP server to use IPv4 only root@server:~# echo "yes" > /etc/pure-ftpd/conf/IPV4Only Last Step) Restart pure-FTP server for changes to take effect root@server:~# service pure-ftpd restart Optional configurations you may need: Defining passive ports (passive port range 21000 to 21100 in example below) root@server:~# echo "21000 21100" > /etc/pure-ftpd/conf/PassivePortRange Set maximum number of clients (50 clients in example below) root@server:~# echo "50" >...
Nov 6, 2013 | Linux Shell Scripting, Ubuntu 12.04 Server Management
Using zip command to compress folders and files zip -r compressed_filename.zip folderorfiles
Oct 9, 2013 | Linux Shell Scripting
Your colleagues were trying to access production server via FTP. However exceeded the maximum number of failed logins, their IP address got blacklisted on iptables. How do you remove their ip address from the blacklist? Check their ip address with iptables # sudo iptables -L ... Chain fail2ban-vsftpd (1 references) target prot opt source destination DROP all -- 192.168.1.156 anywhere RETURN all -- anywhere anywhere Remove ip address from iptables # sudo iptables -D fail2ban-vsftpd -s 192.168.1.156 -j DROP Verify the iptables # sudo iptables -L ... Chain fail2ban-vsftpd (1 references) target prot opt source destination RETURN all -- anywhere...