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

Why Seconds_Behind_Master is still 0 when MySQL synchronization delay occurs

Table of contents Problem Description Principle A...

CentOS7 deploys version 19 of docker (simple, you can follow it)

1. Install dependency packages [root@localhost ~]...

Detailed explanation of jQuery's core functions and event handling

Table of contents event Page Loading Event Delega...

Solution to the Docker container being unable to access the host port

I recently encountered a problem at work. The doc...

Docker image optimization (from 1.16GB to 22.4MB)

Table of contents The first step of optimization:...

Detailed explanation of VUE's data proxy and events

Table of contents Review of Object.defineProperty...

js implements custom drop-down box

This article example shares the specific code of ...

Native JS to achieve digital table special effects

This article shares a digital clock effect implem...

Alibaba Cloud Centos7.3 installation mysql5.7.18 rpm installation tutorial

Uninstall MariaDB CentOS7 installs MariaDB instea...

How to modify the default network segment of Docker0 bridge in Docker

1. Background When the Docker service is started,...

Some suggestions for ensuring MySQL data security

Data is the core asset of an enterprise and one o...

How to implement animation transition effect on the front end

Table of contents Introduction Traditional transi...

Let IE support CSS3 Media Query to achieve responsive web design

Today's screen resolutions range from as smal...

Tutorial on building svn server with docker

SVN is the abbreviation of subversion, an open so...