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

Web project development VUE mixing and inheritance principle

Table of contents Mixin Mixin Note (duplicate nam...

Example code for using HTML ul and li tags to display images

Copy the following code to the code area of ​​Drea...

Detailed installation process of mysql5.7.21 under win10

This article shares the installation of MySQL 5.7...

Detailed explanation of using MySQL where

Table of contents 1. Introduction 2. Main text 2....

Which one should I choose between MySQL unique index and normal index?

Imagine a scenario where, when designing a user t...

Solution to the failure of entering the container due to full docker space

Since the problem occurred rather suddenly and th...

Vue uses plug-ins to cut pictures in proportion

This article shares the specific code of Vue usin...

An article tells you how to write a Vue plugin

Table of contents What is a plugin Writing plugin...

What is the file mysql-bin.000001 in mysql? Can it be deleted?

After installing MySQL using ports, I found that ...

Definition and usage of MySQL cursor

Creating a Cursor First, create a data table in M...

A brief discussion on the calculation method of key_len in mysql explain

The MySQL explain command can analyze the perform...

TypeScript uses vscode to monitor the code compilation process

Install Install ts command globally npm install -...

Vue3.0 routing automatic import method example

1. Prerequisites We use the require.context metho...

The latest version of MySQL5.7.19 decompression version installation guide

MySQL version: MySQL Community Edition (GPL) ----...