Sunday, 14 February 2016

Accessing a FTP Server through the Internet using Dynamic IP

Steps to create FTP server on localhost :


Used Software/Hardware:

Operating System - Ubuntu
Linksys WRT54G Router
vsftpd FTP Server

1.Step 1 Install vsftpd

sudo apt-get install vsftpd

2. Step 2 configure vsftpd config file.

computer / etc / vsftpd.conf

do the following changes to the vsftpd config file.

anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES

use sudo nautilus from terminal to run as root,
enabling one to save changes

3.Step 3: (copied from this site
http://www.liquidweb.com/kb/how-to-install-and-
configure-vsftpd-on-ubuntu-14-04-lts/)

Configure the User’s Home Directory

With certain version of vsftpd you may receive the following error:
500 OOPS: vsftpd: refusing to run with writable root inside chroot().

Not to worry! Create a new directory for the user receiving the
error(user2 in this case) that is a sub-directory of their home
directory (/home/user2).

For example:

Fix permissions for user2‘s home directory:

chmod a-w /home/user2/

Make a new directory for uploading files:

mkdir /home/user2/files
chown user2:user2 /home/user2/files/

4. Step 4 

Accessing the FTP Server through the Internet.

> nmap localhost to check is port is open,in this case 21

> Open ports to the Internet in the Firewall,check screen
    shot,I am using Gufw firewall.

> Port forward in the Router,check screen shot



5.Step 5 

> use ftp:// public dynamic IP
    or use a Client such as filezilla. 

Error:
If unable to Login to one's Computer after this 
configuration(and a restart) run this command 
from another user id or safe mode
chown username:username /home/username
source: 


FTP is insecure. To encrypt the Data FTPS or SFTP is
needed.

some links
Link1
Link2

Google offcourse..

SFTP is recommended over FTPS

Screen shots:

1.I allowed access through my Firewall.


2.Opened the FTP site using my dynamic IP shown on the top.

3.FTP index of files.

4.Port Forwarding, opening Ports in my Router.




No comments:

Post a Comment