Implementation steps for installing FTP server in Ubuntu 14.04

Implementation steps for installing FTP server in Ubuntu 14.04

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

Install

Use the following command to install the ftp server

sudo apt install vsftpd

insert image description here

Software Management

Software management method

service vsftpd start Start service vsftpd restart Restart service vsftpd stop Stop service vsftpd status Check the status

Anonymous access mode

Modify the configuration file

gedit /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 server

Command line login

ftp 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. 

insert image description here

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

insert image description here

insert image description here

insert image description here

Access under Windows

First get the Linux IP address

ifconfig 

insert image description here

Next, enter the address in the window's file manager

ftp://192.168.183.128

insert image description here

System User Access

Modify the configuration file

1. 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

insert image description here

After the configuration is complete, restart.

service vsftpd restart

Client logs in to the server

There are also three ways to access the ftp

Command line login

insert image description here

Folder to connect to the server

insert image description here

insert image description here

Access under Windows

insert image description here

Virtual 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!
Then we need to set up a virtual user to log in, which is also the recommended way! This method is much safer!

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 Tools

Install the following tools to generate password account verification

sudo apt install db-util

create Account

Create the ftpuser account for the following experiments and change the password

useradd ftpuser -s /sbin/nologin
passwd ftpuser

Modify the overall configuration

gedit /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

insert image description here

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 information

Switch 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 server

Restart 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

insert image description here

Folder to connect to the server

insert image description here

insert image description here

Access under Windows

insert image description here

insert image description here

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:
  • Implementation code for installing vsftpd in Ubuntu 18.04
  • Install and configure FTP server in Ubuntu
  • Detailed steps to install vsftpd FTP on Ubuntu

<<:  Example code for drawing double arrows in CSS common styles

>>:  Use vertical-align to align input and img

Recommend

The latest mysql-5.7.21 installation and configuration method

1. Unzip the downloaded MySQL compressed package ...

JavaScript implements password box verification information

This article example shares the specific code of ...

Some methods to optimize query speed when MySQL processes massive data

In the actual projects I participated in, I found...

Detailed explanation of Vue development Sort component code

Table of contents <template> <ul class=&...

How to use JSZip compression in CocosCreator

CocosCreator version: 2.4.2 Practical project app...

How to create dynamic QML objects in JavaScript

1. Dynamically create objects There are two ways ...

Tutorial on installing GreasyFork js script on mobile phone

Table of contents Preface 1. Iceraven Browser (Fi...

11 common CSS tips and experience collection

1. How do I remove the blank space of a few pixels...

A brief introduction to Linux environment variable files

In the Linux system, environment variables can be...

How to specify parameter variables externally in docker

This article mainly introduces how to specify par...

Six tips to increase web page loading speed

Secondly, the ranking of keywords is also related ...