Skip to main content

Posts

Showing posts from April, 2015

How To Setup FTP server on centos 7 ( VSFTP )

From :  http://www.krizna.com/centos/setup-ftp-server-centos-7-vsftp/ FTP server is used to exchange files between computers over network . This guide helps you to setup ftp server on centos 7 . This guide contains configuration steps for both FTP and SFTP as well as user creation . Here i've used VSFTP package which is secure and less vulnerable . 1.  FTP Server 2.  SFTP Server 3.  User creation Setup FTP server on centos 7 Step 1 »  Update your repository and install VSFTPD package . [root@krizna ~]# yum check-update [root@krizna ~]# yum -y install vsftpd Step 2 »  After installation you can find  /etc/vsftpd/vsftpd.conf  file which is the main configuration file for VSFTP. Take a backup copy before making changes . [root@krizna ~]# mv /etc/vsftpd/vsftpd.conf /etc/vsftpd/ vsftpd.conf.org Now open the file and make changes as below [root@krizna ~]# nano /etc/vsftpd/vsftpd.conf Find this line  anonymous_enable=YES  ( Line no : 12 ) and change value to NO to disable anonymous FTP ac

How to secure /tmp and /var/tmp

Secure /tmp Edit /etc/fstab by typing the command  nano -w /etc/fstab Paste the following at the bottom of /etc/stab that you just opened:  none /tmp tmpfs nodev,nosuid,noexec 0 0 Press  ctrl + x  to close the file, press  y  to save it. Remount /tmp by typing the following then press enter: mount -o remount /tmp You can verify that /tmp is correctly mounted by typing  df -h  and you should see something similar to the following: none 3.9G   0  3.9MG   0% /tmp. Secure /var/tmp Backup /var/tmp by typing the following: mv /var/tmp /var/tmpbackup Make a symbolic link that makes /var/tmp point to /tmp by typing the following: ln -s /tmp /var/tmp Copy back the old data using the command: cp /var/tmpbackup/* /tmp/ Remove the un-needed backup you created: rm -rf /var/tmpbackup You should now reboot your VPS. This means /tmp and /var/tmp are now secured. source:  http://crm.vpscheap.net/

25 Most Frequently Used Linux IPTables Rules Examples

  In the below examples we are using ETH0 as network interface, however your interface name might also be called VENET0:0 Please run: ifconfig to determine the correct name.   1. Delete Existing Rules Before you start building new set of rules, you might want to clean-up all the default rules, and existing rules. Use the iptables flush command as shown below to do this. iptables -F (or) iptables --flush 2. Set Default Chain Policies The default chain policy is ACCEPT. Change this to DROP for all INPUT, FORWARD, and OUTPUT chains as shown below. iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT DROP When you make both INPUT, and OUTPUT chain's default policy as DROP, for every firewall rule requirement you have, you should define two rules. i.e one for incoming and one for outgoing. In all our examples below, we have two rules for each scenario, as we've set DROP as default policy for both INPUT and OUTPUT chain. If you trust your internal users, you can omi

How To Setting up Apache Virtual Hosts in Ubuntu 14.04

Setting up Apache Virtual Hosts in Ubuntu 14.04 is a little complicated. First, you have to make directory for you web.  mkdir /home/UserA/htdocs sudo chown -R UserA:UserA  /home/UserA/htdocs sudo chmod -R 755  /home/UserA/htdocs Next we'll create a test page for our virtual host. echo 'Test Site' >  /home/UserA/htdocs /index.html Now we are going to start with a sane configuration for our new virtual host. cd /etc/apache2/sites-available sudo cp 000-default.conf 001-UserA.conf We need to edit our base configuration for our purposes. sudo nano  001-UserA.conf In the file that opens change the  ServerAdmin  to your own email address  DocumentRoot  to our document root and add  ServerName  and set that to the name of the website ServerAdmin admin@UserA.com DocumentRoot  /home/UserA/htdocs ServerName UserA We also want to set the different log files for our hosts so change the  ErrorLog  and  CustomLog  to read something like this: ErrorLog ${APACHE_LOG_DIR}/UserA.error.log

How To Adding Additional Disk Drives to CentOS 5/6

Adding a new drive to CentOS or RedHat systems. Making use of a second drive for extra space? Here's a quick run-down: 1) Make sure you know which disk is being formatted. First, second, and third drives will be /dev/sda, /dev/sdb, and /dev/sdc respectively. Check this with  fdisk -l [03:50:04] [root@virt ~]# fdisk -l Disk /dev/sda: 34.3 GB, 34359738368 bytes 255 heads, 63 sectors/track, 4177 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 4177 33447330 8e Linux LVM Disk /dev/sdb: 8589 MB, 8589934592 bytes 255 heads, 63 sectors/track, 1044 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/sdb doesn't contain a valid partition table 2) You can see that /dev/sdb (our second hard drive) does not have any partitions. We will need to create a partition(s) on the drive and th

How To Get Hard Drive UUID’s

[root@demby vhosts]#ls -l /dev/disk/by-uuid/   total 0   lrwxrwxrwx 1 root root 9 Jan 10 15:43 3ecf7894-ef6e-4fc4-a8fb-b26d358ad775 -> ../../sdd   lrwxrwxrwx 1 root root 9 Jan 10 15:43 61a9142a-b78f-4c90-a476-5ac481d5cc73 -> ../../sdc   lrwxrwxrwx 1 root root 10 Jan 10 15:43 808d3e8b-b8f9-41ae-a457-4e44dede3cd1 -> ../../sdf1   lrwxrwxrwx 1 root root 10 Jan 10 15:43 9f68a4e4-b166-4b22-8292-4cb263d341aa -> ../../sde1   lrwxrwxrwx 1 root root 9 Jan 10 15:43 d0e98842-e77c-402b-998c-41de47b359ba -> ../../sdb   lrwxrwxrwx 1 root root 10 Jan 10 15:43 df5e34f5-dd65-47ba-8690-2f09702d7b27 -> ../../sda1 That's all source: dbiers.me