Sunday, 29 March 2020

Linux Adventure - Installing and configure an ftp server and user


 Ubantu does not come directly with the FTP server installed, you first need to install a ftp server. I have opt for the vsftp server, there are some other choices which you can explore. Once you run this command it will connect to internet and will download and install the vsftp server.
sudo apt-get install vsftpd
Now once its installed its better to have a copy of the configuration file, it wil help if any corruption in the file.
sudo cp /etc/vsftpd.conf /etc/vsftpd.conf.orig
Now open this file and add the following content to make it working for the user list you want to work, and run the command to allow connection from 20 and 21 from outside. Otherwise firewall will block it. 
vim /etc/vsftpd.conf 
and add following 

userlist_file=/etc/vsftpd.userlist
userlist_enable=YES
userlist_deny=NO
pasv_enable=Yes
pasv_min_port=10000
pasv_max_port=11000
user_sub_token=$USER
local_root=/home/$USER/ftp
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
sudo systemctl restart vsftpd
ufw allow from any to any port 20,21 proto tcp
Now add the ftepdemo user.   -m in the below command ensure that this user created with home directory. 
sudo useradd -m ftpdemouser
Now set a password for this user and remember it. 
passwd ftpdemouser
Create following directory and change the permission to get the access.



sudo chown nobody:nogroup /home/ftpdemouser/ftp
sudo chmod a-w /home/ftpdemouser/ftp

sudo mkdir  /home/ftpdemouser/ftp/test
sudo chown ftpdemouser:ftpdemouser  /home/ftpdemouser/ftp/test 

Now restart the server one more time. 


sudo systemctl restart vsftpd
Now open putty or winscp and use the file protocal as ftp to connect.



Once information filling complete, please use host name, for the connection. it will give the directory for you. Upload a file and enjoy.

Please let me know if you face problem in anytime.







No comments:

Post a Comment

Feature Selection in AI

In artifical intelegance/machine learning, everything start and end with data and in current world everyday by using facebook, insta we all ...