The landlord wants to share more than 200 GB of movies on the hard drive to his colleagues in the lab, so he wants to build an FTP server on the Intranet server.
1. install FTP
First, enter the following content in the terminal to install ftpserver:
Sudo apt-Get install vsftpd
2. Configure ftp
Modify the FTP configuration file. In the/etc folder, enter the following command in the terminal to open the configuration file:
Sudo gedit/etc/vsftpd. conf
You can simply change the following configuration items:
# Prohibit anonymous users from asking anonymous_enable = No # accept local users local_enable = yes # users who can upload write_enable = yes # enable chroot_list_file in the chroot_list_enable = yeschroot_list_file =/etc/ vsftpd. chroot_list
Save and close.
3. Set related folders
After installing ftpserver in step 1, an FTP directory will appear in the/var directory, enter the/var/FTP directory in the terminal, and create an upload and download directories respectively under the FTP directory, the command is as follows:
Sudo mkdir downloadsudo mkdir upload
Then you need to change the folder permission. The command to change the folder permission is:
Sudo chmod 755/var/ftpsudo chmod 777/var/FTP/uploadsudo chmod 755/var/FTP/download
4. Configure an FTP user
Enter the following command in the terminal to add a group:
Sudo groupadd ftpgroup
Add User 301 (username is optional) and set its root folder to/var/FTP/upload:
Sudo useradd-G ftpgroup-D/var/FTP/upload-M 301
Set User Password:
Sudo passwd 301
Enter the logon password of the 301 user as prompted.
Edit the chroot_list file to add 301 users:
Sudo gedit/etc/vsftpd. chroot_list
Restart ftpserver:
Sudo service vsftpd start
Then other users on the Intranet can log on to the server through a browser or ftpclient.
Intranet login mode is to enter ftp: // 192.168.0.254 in the browser or client (this address is the Intranet address of ftpserver, Please configure according to your own IP address)
To log on to the Internet, enter ftp: // 115.156.236.116 in the browser or client (this address is the Internet address of ftpserver. Please configure it based on your own IP address)
5. When logging on as a 301 user, if the upload or download fails, you can first consider whether the file has the permission to the 301 user.