FTP: File Transfer Protocol, used to upload and download files between two computers. Sometimes we need to upload local files to a remote Ubuntu 14.04 server, or download files from a remote Ubuntu 14.04 server to the local computer, which requires setting up FTP InstallUse the following command to install the ftp server sudo apt install vsftpd Software ManagementSoftware management method service vsftpd start Start service vsftpd restart Restart service vsftpd stop Stop service vsftpd status Check the status Anonymous access modeModify the configuration filegedit /etc/vsftpd.conf And write the configuration anonymous_enable=YES anon_root= /data/pub local_enable=YES anon_upload_enable=YES anon_mkdir_write_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES listen=YES #listen_ipv6=NO pam_service_name=vsftpd userlist_enable=NO tcp_wrappers=YES After the configuration is complete, create folders and files and restart the server mkdir -p /data/pub touch /data/pub/a.txt chmod -R 777 /data chmod aw /data/pub service vsftpd restart Client logs in to the serverCommand line loginftp 127.0.0.1 Then enter the username Anonymous Finally, enter ls. If the effect shown in the figure is displayed, it means that the creation is successful. Connect to the server in the folder Use the folder to access the server, and finally you can see the file 1.txt in the folder Access under WindowsFirst get the Linux IP address ifconfig Next, enter the address in the window's file manager System User AccessModify the configuration file1. Modify the configuration file gedit /etc/vsftpd.conf And write the configuration anonymous_enable=NO local_enable=YES userlist_enable=YES userlist_deny=NO 2. Write the username that is allowed to access gedit /etc/vsftpd.user_list Add your own user, for example, if my computer user is ubuntu, then write ubuntu in the file After the configuration is complete, restart. service vsftpd restart Client logs in to the serverThere are also three ways to access the ftp Command line loginFolder to connect to the serverAccess under WindowsVirtual user access mode Although the system user mode can control access, if there are too many users, it will affect the management of the server system and pose a threat to server security! And all we need is to be able to use the FTP service built on the server! A virtual user is a user without an actual system user. Instead, it implements access verification by mapping to one of the real users and setting corresponding permissions. Virtual users cannot log in to the Linux system, making the system more secure and reliable. Installation ToolsInstall the following tools to generate password account verification sudo apt install db-util create AccountCreate the ftpuser account for the following experiments and change the password useradd ftpuser -s /sbin/nologin passwd ftpuser Modify the overall configurationgedit /etc/vsftpd.conf And write the configuration anonymous_enable=NO local_enable=YES userlist_enable=YES #userlist_deny=NO guest_enable=YES guest_username=ftpuser #same as the username created previously virtual_use_local_privs=YES pam_service_name=vsftpd user_config_dir=/etc/vsftpd/virtualconf #Remember this path Create a configuration folder to store each user's configuration mkdir -p /etc/vsftpd/virtualconf Create and store user passwords vi /etc/vsftpd/virtusers Store username and password in a file At the same time, use the db command to generate the database file db_load -T -t hash -f /etc/vsftpd/virtusers /etc/vsftpd/virtusers.db Modify the pam configuration file gedit /etc/pam.d/vsftpd Delete all the contents of the file and replace the following configuration auth required /lib/x86_64-linux-gnu/security/pam_userdb.so db=/etc/vsftpd/virtusers account required /lib/x86_64-linux-gnu/security/pam_userdb.so db=/etc/vsftpd/virtusers Configure each user informationSwitch to the user configuration directory mkdir -p /home/ftpuser/ftp1 chown ftpuser.ftpuser /home/ftpuser cd /etc/vsftpd/virtualconf/ gedit ftp1 Write the following configuration into the file local_root=/home/ftpuser/ftp1 write_enable=YES anon_world_readable_only=NO anon_upload_enable=YES anon_mkdir_write_enable=YES anon_other_write_enable=YES At this point, the configuration is complete Client logs in to the serverRestart the following ftp servers before logging in service vsftpd restart We now create a file in the shared directory for subsequent verification and viewing touch /home/ftpuser/ftp1/1.txt Next, log in using the same three methods Command line login You can see that 1.txt is the file just created Folder to connect to the server Access under Windows At this point, all three FTP modes have been configured and implemented. This is the end of this article about the implementation steps of installing FTP server in Ubuntu 14.04. For more information about installing FTP in Ubuntu 14.04, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Example code for drawing double arrows in CSS common styles
>>: Use vertical-align to align input and img
1. Unzip the downloaded MySQL compressed package ...
1. Unzip mysql-8.0.21-winx64 2. Configure environ...
by Take the effect shown in the picture as an exa...
This article example shares the specific code of ...
In the actual projects I participated in, I found...
Table of contents <template> <ul class=&...
CocosCreator version: 2.4.2 Practical project app...
1. Dynamically create objects There are two ways ...
Table of contents Preface 1. Iceraven Browser (Fi...
In web front-end development, it is inevitable to ...
1. How do I remove the blank space of a few pixels...
In the Linux system, environment variables can be...
This article mainly introduces how to specify par...
Secondly, the ranking of keywords is also related ...
Table of contents 1. substring() 2. substr() 3.in...