How to Configure or Setup FTP on an AWS EC2 Instance

It's most important Article in AWS.  EC2 Instance with Linux, Centos and Amazon linux machine (os) Configuration with.
Please below the steps :--
1. Create the linux instance in AWS console  than login from putty
ec2-user@bhandari ~]$ sudo -i
[root@bhandari ~]# yum install vsftpd
2. You need to go to your AWS account in your browser and open up the ports required for FTP access.
This is done by:
1) Login to AWS http://aws.amazon.com/
2) Open up the EC2 panel from the management console
3) Select “security groups” from the left menu and find the relevant one OR select the EC2 instance in question and directly click on the security group from the bottom of the page area
4) Hit “Edit” on the relevant security group INBOUND rules
5) Add two rules Type > Custom TCP Rules – port ranges 20-21 and 1024-1048 (all from source “anywhere” if you want to allow FTP from anywhere, otherwise secure by locking down to just your IP, assuming a) you know this and b) it won’t change!)
[root@bhandari ~]# systemctl restart vsftpd.service
3. Changes in this file like below the list.
[root@bhandari ~]# vi /etc/vsftpd/vsftpd.conf
anonymous_enable=YES
Then add the following to the bottom of the file
pasv_enable=YES
pasv_min_port=1024
pasv_max_port=1048
pasv_address=x.x.x.x

Save file and exit :--
[root@bhandari ~]# systemctl restart vsftpd.service
Note: Open the below option in configuration file.
[root@bhandari ~]# cat /etc/vsftpd/vsftpd.conf | grep -v ^#
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
pasv_enable=YES
pasv_min_port=1024
pasv_max_port=1048
pasv_address=x.x.x.x

4. Create the user.
[root@bhandari ~]# useradd bhandari
[root@bhandari~]# passwd bhandari
Changing password for user bhandari.
New password:
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
Retype new password:
passwd: all authentication tokens updated successfully.
5. Restrict user to home directory
[root@bhandari ~]# vi /etc/vsftpd/vsftpd.conf
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list

Now the check the ftp user connect or not
6. Change the home directory of user and permission
 [root@bhandari ~]#  usermod -d /var/www/html bhandari
Note:- it's connect but not working proper so please change the selinux like (disabled)
[root@bhandari ~]# vi /etc/sysconfig/selinux
SELINUX=disabled

Restart Server
Now it's working fine.
If you want to upload the some images from apache like (website) so please give  the permission

[root@bhandari ~]# usermod -a -G apache bhandari

How to Configure or Setup FTP on an AWS EC2 Instance How to Configure or Setup FTP  on an AWS EC2 Instance Reviewed by Unknown on October 31, 2017 Rating: 5

No comments:

Scribe

http://feeds.feedburner.com/LinuxAndAws
Powered by Blogger.
X

Get Updates On

Linux Tutorial

AWS Tutorial

Devops Tutorial

We are going to send you our resources for free. To collect your copy at first, join our mailing list. So don't miss any updates, stay connected!