Last active
August 29, 2018 04:41
-
-
Save manojkumararyan/0191f639d7a32be6576f682c8e5208ad to your computer and use it in GitHub Desktop.
Revisions
-
manojkumararyan revised this gist
Aug 28, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,6 +46,7 @@ TCP 1024 to 1048 #if enable passive mode ### Test FTP connection ``` ftp <Hostname or Server IP Address> #for normal terminal test #for test using ruby require 'net/ftp' ftp = Net::FTP.new -
manojkumararyan revised this gist
Aug 28, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,7 @@ TCP 1024 to 1048 #if enable passive mode ``` ### Test FTP connection ``` ftp <Hostname or Server IP Address> #for normal terminal test #for test using ruby require 'net/ftp' ftp = Net::FTP.new -
manojkumararyan revised this gist
Aug 28, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,7 @@ TCP 1024 to 1048 #if enable passive mode ``` ### Test FTP connection ``` ftp <Hostname or Server IP Address> *for normal terminal test* #for test using ruby require 'net/ftp' ftp = Net::FTP.new -
manojkumararyan revised this gist
Aug 27, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -56,7 +56,7 @@ ftp.getbinaryfile(<remote file>, <local file>) #download file #sometime PASV(passive mode) fails for some server then EPSV(extended passive mode) is used #to overwrite 'makepasv' in Net::FTP #file epsv.rb require 'net/ftp' module Net -
manojkumararyan revised this gist
Aug 27, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,7 +46,7 @@ TCP 1024 to 1048 #if enable passive mode ### Test FTP connection ``` ftp <Hostname or Server IP Address> #for normal terminal test #for test using ruby require 'net/ftp' ftp = Net::FTP.new ftp.connect(<Hostname or Server IP Address>, 21) -
manojkumararyan revised this gist
Aug 27, 2018 . 1 changed file with 30 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -42,5 +42,35 @@ TCP 20 to 21 TCP 1024 to 1048 #if enable passive mode #again restart vsftpd sudo service vsftpd restart ``` ### Test FTP connection ``` ftp <Hostname or Server IP Address> #for normal terminal test #for test via ruby on rails require 'net/ftp' ftp = Net::FTP.new ftp.connect(<Hostname or Server IP Address>, 21) ftp.login(<ftpuser>,<ftpuser password>) ftp.passive = true ftp.getbinaryfile(<remote file>, <local file>) #download file #sometime PASV(passive mode) fails for some server then EPSV(extended passive mode) is used #to overwrite 'makepasv' in Net::FTP epsv.rb require 'net/ftp' module Net class FTP def makepasv if @sock.peeraddr[0] == 'AF_INET' host, port = parse229(sendcmd('EPSV')) else host, port = parse227(sendcmd('EPSV')) end return host, port end end end ``` ### Done! -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ sudo nano /etc/vsftpd.conf write_enable=YES #for write access local_umask=022 chroot_local_user=YES #chroot_local_user is to restrict local user to their home directories. (/home/{user}/) #Add these lines at bottom of the file allow_writeable_chroot=YES pasv_enable=Yes -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,10 +26,10 @@ sudo nano /etc/vsftpd.conf pasv_addr_resolve=YES pasv_address=<SERVER_FQDN OR SERVER_PUBLIC_IP_ADDRESS> ``` ### Create FTP user & allow login access to nologin shell ``` sudo useradd -m foo -s /usr/sbin/nologin sudo passwd foo sudo nano /etc/shells #open this file Add "/usr/sbin/nologin" to /etc/shells #restart vsftpd -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Setup FTP server (VSFTPD) on AWS EC2 sudo apt-get update sudo apt-get install vsftpd ``` ### Update vsftp.config file ``` sudo nano /etc/vsftpd.conf #uncomment these settings @@ -26,7 +26,7 @@ sudo nano /etc/vsftpd.conf pasv_addr_resolve=YES pasv_address=<SERVER_FQDN OR SERVER_PUBLIC_IP_ADDRESS> ``` ### Create FTP User and allow login access to nologin shell ``` sudo useradd -m robin -s /usr/sbin/nologin sudo passwd robin @@ -35,11 +35,11 @@ Add "/usr/sbin/nologin" to /etc/shells #restart vsftpd sudo service vsftpd restart ``` ### Open ports in AWS EC2 instance security groups ``` TCP 20 to 21 TCP 1024 to 1048 #if enable passive mode #again restart vsftpd sudo service vsftpd restart ``` ### Done! -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Setup FTP server (VSFTPD) on AWS EC2 =============== ### Install vsftpd ``` sudo apt-get update sudo apt-get install vsftpd -
manojkumararyan renamed this gist
Aug 23, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ Setup FTP server (VSFTPD) on AWS EC2 =============== # Install vsftpd ``` sudo apt-get update -
manojkumararyan renamed this gist
Aug 23, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -38,4 +38,5 @@ TCP 20 to 21 TCP 1024 to 1048 #if enable passive mode #again restart vsftpd sudo service vsftpd restart ``` # Done! -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,17 +25,17 @@ sudo nano /etc/vsftpd.conf ``` # Create FTP User and allow login access to nologin shell. (By default, you can use port 21) ``` sudo useradd -m robin -s /usr/sbin/nologin sudo passwd robin sudo nano /etc/shells #open this file Add "/usr/sbin/nologin" to /etc/shells #restart vsftpd sudo service vsftpd restart ``` # Open ports in AWS EC2 instance security groups ``` TCP 20 to 21 TCP 1024 to 1048 #if enable passive mode #again restart vsftpd sudo service vsftpd restart ``` -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,11 @@ # Install vsftpd ``` sudo apt-get update sudo apt-get install vsftpd ``` # Update vsftp.config file ``` sudo nano /etc/vsftpd.conf #uncomment these settings write_enable=YES #for write access local_umask=022 @@ -21,17 +23,17 @@ sudo nano /etc/vsftpd.conf #open this file pasv_addr_resolve=YES pasv_address=<SERVER_FQDN OR SERVER_PUBLIC_IP_ADDRESS> ``` # Create FTP User and allow login access to nologin shell. (By default, you can use port 21) ``` sudo useradd -m robin -s /usr/sbin/nologin sudo passwd robin sudo nano /etc/shells #open this file Add "/usr/sbin/nologin" to /etc/shells #restart vsftpd sudo service vsftpd restart ``` # Open ports in AWS EC2 instance security groups ``` TCP 20 to 21 TCP 1024 to 1048 #if enable passive mode #again restart vsftpd -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ ``` sudo apt-get update sudo apt-get install vsftpd ``` ``` sudo nano /etc/vsftpd.conf #open this file #uncomment these settings write_enable=YES #for write access @@ -19,17 +20,20 @@ sudo nano /etc/vsftpd.conf #open this file #If you do not have a fixed IP address, then add these lines pasv_addr_resolve=YES pasv_address=<SERVER_FQDN OR SERVER_PUBLIC_IP_ADDRESS> ``` ``` #Create FTP User and allow login access to nologin shell. (By defaylt, you can use port 21) sudo useradd -m robin -s /usr/sbin/nologin sudo passwd robin sudo nano /etc/shells #open this file Add "/usr/sbin/nologin" to /etc/shells #restart vsftpd sudo service vsftpd restart ``` ``` #open ports in aws ec2 security groups TCP 20 to 21 TCP 1024 to 1048 #if enable passive mode #again restart vsftpd sudo service vsftpd restart ``` -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ sudo apt-get update ``` sudo apt-get install vsftpd ``` sudo nano /etc/vsftpd.conf #open this file #uncomment these settings write_enable=YES #for write access -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ sudo apt-get update ` sudo apt-get install vsftpd sudo nano /etc/vsftpd.conf #open this file #uncomment these settings -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ sudo apt-get update ``` sudo apt-get install vsftpd sudo nano /etc/vsftpd.conf #open this file #uncomment these settings -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,4 @@ # sudo apt-get update sudo apt-get install vsftpd sudo nano /etc/vsftpd.conf #open this file #uncomment these settings -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ Setup FTP server (VSFTPD) on Amazon EC2 ubuntu sudo apt-get update sudo apt-get install vsftpd sudo nano /etc/vsftpd.conf #open this file -
manojkumararyan revised this gist
Aug 23, 2018 . No changes.There are no files selected for viewing
-
manojkumararyan renamed this gist
Aug 23, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
manojkumararyan revised this gist
Aug 23, 2018 . 1 changed file with 25 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,33 @@ sudo apt-get update sudo apt-get install vsftpd sudo nano /etc/vsftpd.conf #open this file #uncomment these settings write_enable=YES #for write access local_umask=022 chroot_local_user=YES #chroot_local_user is to restrict local user to their home directories. (/home/{user}/) #Add these lines at bottom of the file allow_writeable_chroot=YES pasv_enable=Yes pasv_min_port=1024 pasv_max_port=1048 port_enable=YES #If you use AWS EC2, you have a fixed public IP address, then add these lines pasv_addr_resolve=NO pasv_address=<SERVER_IP_ADDRESS> #If you do not have a fixed IP address, then add these lines pasv_addr_resolve=YES pasv_address=<SERVER_FQDN OR SERVER_PUBLIC_IP_ADDRESS> #Create FTP User and allow login access to nologin shell. (By defaylt, you can use port 21) sudo useradd -m robin -s /usr/sbin/nologin sudo passwd robin sudo nano /etc/shells #open this file Add "/usr/sbin/nologin" to /etc/shells #restart vsftpd sudo service vsftpd restart #open ports in aws ec2 security groups TCP 20 to 21 TCP 1024 to 1048 #if enable passive mode #again restart vsftpd sudo service vsftpd restart -
manojkumararyan created this gist
Aug 23, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ sudo apt-get update sudo apt-get install vsftpd sudo nano /etc/vsftpd.conf #uncomment these settings write_enable=YES #for write access local_umask=022 chroot_local_user=YES #chroot_local_user is to restrict local user to their home directories. (/home/{user}/) #Add these lines at bottom of the file allow_writeable_chroot=YES pasv_enable=Yes pasv_min_port=1024 pasv_max_port=1048 port_enable=YES #If you use AWS EC2, you have a fixed public IP address, then add these lines pasv_addr_resolve=NO pasv_address=<SERVER_IP_ADDRESS> #If you do not have a fixed IP address, then add these lines pasv_addr_resolve=YES pasv_address=<SERVER_FQDN OR SERVER_PUBLIC_IP_ADDRESS> sudo useradd -m robin -s /usr/sbin/nologin #Create FTP User and allow login access to nologin shell. (By defaylt, you can use port 21) sudo passwd robin sudo nano /etc/shells Add "/usr/sbin/nologin" to /etc/shells sudo service vsftpd restart Open ports in aws ec2 security groups TCP 20 to 21 TCP 1024 to 1048 #if enable passive mode sudo service vsftpd restart