VIRTUAL HOSTING WITH PureFTPd And MYSQL (Quota And Bandwidth Management) BY Odoh Kenneth Emeka Sun Yu Patrick Appiah.

Slides:



Advertisements
Similar presentations
LIS651 lecture 5 direct use of wotan Thomas Krichel
Advertisements

Unit 5 – User Administration Randy Marchany VA Tech Computing Center.
Linux Users and Groups Management
1 Web Servers / Deployment Alastair Dawes Original by Bhupinder Reehal.
1 Computer Files Stored on disks, CDs, tapes, in memory. Types of files: plain text, formatted (.doc.xls etc…), binary (executable). A disk has a directory.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
Linux Security 資管研究生 劉順德. Outline General Security –Account –Local –Network –Patch Services Security –Sendmail –BIND/DNS –Apache –FTP Recent Linux security.
George Blank University Lecturer. Creating A Web Site at NJIT Professor Blank.
Computers in Principle and Practice Servers and Operating Systems.
Amazon EC2 Quick Start adapted from EC2_GetStarted.html.
A crash course in njit’s Afs
Telnet/SSH: Connecting to Hosts Internet Technology1.
One to One instructions Installing and configuring samba on Ubuntu Linux to enable Linux to share files and documents with Windows XP.
DEDS Migration to secured FTP For discussion with GNP Industry.
Eucalyptus Virtual Machines Running Maven, Tomcat, and Mysql.
Penetration Testing Training Day Capture the Flag Training.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
1 Web Server Administration Chapter 9 Extending the Web Environment.
System Administration HW2 - FTP, Samba, BT, ZFS jwbai.
VsFTP in Linux. Introduction to FTP The File Transfer Protocol (FTP) is used as one of the most common means of copying files between servers over the.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
Microsoft Internet Information Services 5.0 (IIS) By: Edik Magardomyan Fozi Abdurhman Bassem Albaiady Vince Serobyan.
Samba Advanced System Administration Course James Lwali University computing Centre Ltd, University of Dar es salaam,
FTP Server and FTP Commands By Nanda Ganesan, Ph.D. © Nanda Ganesan, All Rights Reserved.
ITN Wake Tech1 ITN270 Advanced Internet Databases Lecture 15. General MySQL Administration Topics: –Securing a New MySQL Installation –MySQL Server.
Network Security: Lab#3 Transport-Level Security Tools J. H. Wang May 12, 2011.
FTP Presentation Using “CuteFTP” By IT the IT Support Team.
There are three types of users in linux  System users: ?  Super user: ?  Normal users: ?
Managing Users  Each system has two kinds of users:  Superuser (root)  Regular user  Each user has his own username, password, and permissions that.
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 13 FTP and Telnet.
Chapter 3 & 6 Root Status and users File Ownership Every file has a owner and group –These give read,write, and execute priv’s to the owner, group, and.
1 Linux Security. 2 Linux is not secure No computer system can ever be "completely secure". –make it increasingly difficult for someone to compromise.
Networking in Linux. ♦ Introduction A computer network is defined as a number of systems that are connected to each other and exchange information across.
Configuring a LAN FTP Client Chapter 17 & 19. Setting up the physical layer Chapter 17 covers the basics of hubs, switches, routers and WAPs.
System Administration HW2 - File System Server ylin.
System Administration HW2 - File System Server. Computer Center, CS, NCTU 2 FTP  Install a FTP server for FreeBSD Pure-FTPd: /usr/ports/ftp/pure-ftpd.
Linux Services Configuration
Host Security Overview Onion concept of security Defense in depth How secure do you need to be? You can only reduce risk Tradeoffs - more security means:
Apache, MySQL and PHP Installation and Configuration Chapter 2 MySQL Installation and Configuration.
Database server Campus-Booster ID : ****** Copyright © SUPINFO. All rights reserved MySQL.
DATA BASE ADMINISTRING DATABASE SERVICES IN RED HAT LINUX.
SQOOP INSTALLATION GUIDE Lecturer : Prof. Kyungbaek Kim Presenter : Zubair Amjad.
SCSC 455 Computer Security Chapter 3 User Security.
Basic Service & Settings xclin. Computer Center, CS, NCTU 2 If you want to transfer a file…
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
FTP COMMANDS OBJECTIVES. General overview. Introduction to FTP server. Types of FTP users. FTP commands examples. FTP commands in action (example of use).
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
File Transfer Protocol (FTP) CIS 130. File Transfer Protocol (FTP) Copy files from one internet host (server) to your account on another host –Need domain.
Unit – 5 FTP Server. FTP Introduction One of the oldest and most commonly used protocols The original specification for the File Transfer Protocol was.
Integrity Check As You Well Know, It Is A Violation Of Academic Integrity To Fake The Results On Any.
Lab 3.21 MySQL Database Lab Developing the Tools May 5 th, 2004 Montréal, Québec Dominik Gehl Hôpital Ste-Justine, Montréal.
Settings MySQL Database and JDBC configuration Instructor: Sergey Goldman.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
Lecture 8: FTP into CS System Topics: FTP connect, browse, upload, download Date: Mar 8, 2016.
WordPress and Etherpad with BlueMix and Docker. Our aim is to run on BlueMix containers (now in beta) these two famous services In the BlueMix dashboard,
COM621: Advanced Interactive Web Development Lecture 10 PHP and MySQL.
Lightweight Directory Access Protocol Objectives –This chapter will first show you how to install and use LDAP Contents –The LDAP Database Structure –Scenario.
PRESENTED BY ALI NASIR BITF13M040 AMMAR HAIDER BITF13M016 SHOIAB BAJWA BITF13M040 AKHTAR YOUNAS BITF13M019.
Pure-FTPd Stetting up and using Pure-FTPd (on Gentoo) Zahari V. Zahariev Sys admin, EuroIntegra Ltd.
Chapter 9 Router Configuration (Ospf, Rip) Webmin, usermin Team viewer
Introduction to SQL Server 2000 Security
FTP - File Transfer Protocol
Web Server Administration
Lab 1 introduction, debrief
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
Chapter 27: System Security
Web Programming Essentials:
COP 4343 Unix System Administration
System Administration HW3 - File System Server
System Administration Practice Homework2 - File System Server
Presentation transcript:

VIRTUAL HOSTING WITH PureFTPd And MYSQL (Quota And Bandwidth Management) BY Odoh Kenneth Emeka Sun Yu Patrick Appiah

FTP FTP is an acronym for File Transfer Protocol What is a protocol? FTP  Client / server architecture  Port 21 for incoming connection.  TCP protocol

ADVANTAGES OF FTP Easy to use Low bandwidth Control over transfer e.g. choosing how data is transferred with binary, executable e.t.c

Disadvantages of FTP SECURITY Using ch’root file server with suitable file permission can deter simple attacks but SSH or TLS is a better option as password is not transferred in clear text.

Security in virtual hosting project Ch’root FTP.  User is directed to a specially made home directory with minimal permissions.  Users don’t have shell  few commands e.g ls  System files are inaccessible to users.

Software used for virtual hosting project

Project Requirement Project Requirement Scalable Handle both authenticated user and anonymous user. Implement quota management and upload/download bandwidth limits management.

Procedures Note: Always back up any configuration file before making any changes. Log into the computer using the administrator account. $ sudo su Configure the static IP address by editing the /etc/hosts file. Install mysql-server,mysql-client, phpmyadmin and Apache2. $ aptitude install mysql-server mysql- client phpmyadmin apache2

Procedure cont… Install the package that enables connection between pureFtp and mysql. $ aptitude install pure-ftpd-mysql Then we create an ftp group (ftpgroup) and user (ftpuser) that all our virtual users will be mapped to. Replace the group- and userid with 2001  $ groupadd -g 2001 ftpgroup $ useradd -u s /bin/false -d /bin/null -c "pureftpd user" -g ftpgroup ftpuser

Procedure cont… We create a database called pureftpd and an mysql user called pureftp.We would log in into the mysql database as root using the command. #remember to start mysql server $ mysql -u root –p CREATE DATABASE pureftpd; Then creates a user and grant them the required priviledges GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO IDENTIFIED BY 'ftpdpass'; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO IDENTIFIED BY 'ftpdpass'; FLUSH PRIVILEGES;

Procedure cont… USE pureftpd; CREATE TABLE ftpd ( User varchar(16) NOT NULL default '', status enum('0','1') NOT NULL default '0', Password varchar(64) NOT NULL default '', Uid varchar(11) NOT NULL default '-1', Gid varchar(11) NOT NULL default '-1', Dir varchar(128) NOT NULL default '', ULBandwidth smallint(5) NOT NULL default '0', DLBandwidth smallint(5) NOT NULL default '0', comment tinytext NOT NULL, ipaccess varchar(15) NOT NULL default '*', QuotaSize smallint(5) NOT NULL default '0', QuotaFiles int(11) NOT NULL default 0, PRIMARY KEY (User), UNIQUE KEY User (User) ) TYPE=MyISAM;

Procedure cont… $ touch /etc/pure-ftpd/db/mysql.conf_orig Now I have to copy the configuration files from /etc/pure-ftpd/db/mysql.conf to /etc/pure-ftpd/db/mysql.conf_orig using the cp command. $cp /etc/pure-ftpd/db/mysql.conf /etc/pure- ftpd/db/mysql.conf_orig I have to edit the file /etc/pure- ftpd/db/mysql.conf $ nano /etc/pure-ftpd/db/mysql.conf

Procedure cont… MYSQLSocket /var/run/mysqld/mysqld.sock #MYSQLServer localhost #MYSQLPort 3306 MYSQLUser pureftpd MYSQLPassword pureftpd MYSQLDatabase pureftpd #MYSQLCrypt md5, cleartext, crypt() or password() - md5 is VERY RECOMMENDABLE uppon cleartext MYSQLCrypt md5 MYSQLGetPW SELECT Password FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")

Procedure cont… MYSQLGetUID SELECT Uid FROM ftpd WHERE User="\L" AND status="1" AND(ipaccess = "*" OR ipaccess LIKE "\R") MYSQLGetGID SELECT Gid FROM ftpd WHERE User="\L"AND status="1" AND(ipaccess = "*" OR ipaccess LIKE "\R") MYSQLGetDir SELECT Dir FROM ftpd WHERE User="\L"AND status="1" AND(ipaccess = "*" OR ipaccess LIKE "\R") MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User="\L"ANDstatus="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User="\L"ANDstatus="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User="\L"AND status="1"AND (ipaccess = "*" OR ipaccess LIKE "\R") MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User="\L"AND status="1"AND (ipaccess = "*" OR ipaccess LIKE "\R")

CH’ROOT Configuration Then create the file /etc/pure-ftpd/conf/ChrootEveryone which simply contains the string yes: $touch /etc/pure-ftpd/conf/ChrootEveryone $echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone This will make PureFTPd chroot every virtual user in his home directory so he will not be able to browse directories and files outside his home directory. create the file /etc/pure-ftpd/conf/CreateHomeDir which again simply contains the string yes. $touch /etc/pure-ftpd/conf/CreateHomeDir $echo "yes" > /etc/pure-ftpd/conf/CreateHomeDir This will make PureFTPd create a user's home directory when the user logs in and the home directory does not exist yet. create the file /etc/pure-ftpd/conf/DontResolve which again simply contains the string yes.

Cont.. $touch /etc/pure- ftpd/conf/DontResolve $echo "yes" > /etc/pure- ftpd/conf/DontResolve This will make that PureFTPd reduce bandwidth usage. We have to restart the pureftpd server $ /etc/init.d/pure-ftpd-mysql restart

Testing the project INSERT INTO `ftpd` (`User`, `status`, `Password`, `Uid`, `Gid`, `Dir`,`ULBandwidth`, `DLBandwidth`, `comment`, `ipaccess`, `QuotaSize`,`QuotaFiles`) VALUES ('exampleuser', '1', MD5('secret'), '2001', '2001','/home/ '100', '100', '', '*', '50', '0');

Creating Anonymous User INSERT INTO `ftpd` (`User`, `status`, `Password`, `Uid`, `Gid`, `Dir`,`ULBandwidth`, `DLBandwidth`, `comment`, `ipaccess`, `QuotaSize`,`QuotaFiles`) VALUES ('ftp', '1', MD5(''), '2001', '2001', '/home/ftp', '100', '100', '','*', '50', '0'); quit; Create the file /etc/pure_ftpd/conf/NoAnonymous This configuration will allow anonymous login. $ touch /etc/pure-ftpd/conf/NoAnonymous $ echo "no" > /etc/pure-ftpd/conf/NoAnonymous

$ /etc/init.d/pure-ftpd-mysql restart $ cd /home/ftp $ mkdir incoming $ chown ftp:nogroup incoming/ $ chmod 311 incoming/ $ cd../ $ chmod 555 ftp/ Now anonymous users can login, and they can download files from /home/ftp, but uploads are limited to /home/ftp/incoming (and once a file is uploaded into /home/ftp/incoming, it cannot be read nor downloaded from there; the server admin has to move it into /home/ftp first to make it available to others

Cont… log in $ ftp

References onvalleyccie.com/index.htm 8/11/configure-ftp-server-onubuntu.html with-pureftpd-and-mysql-incl-quotaand- bandwidth-management-on-ubuntu-9.10-p2

END THANKS