Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Ubuntu 16 VSFTP erection

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Root@myserverftp:~# sudo apt-get update

Root@myserverftp:~# sudo apt-get install vsftpd

Root@myserverftp:/home/myserver# service vsftpd restart

Root@myserver-ftp:/etc# vi vsftpd.conf

Listen=YES

Run standalone with IPv6?Like the listen parameter, except vsftpd will listen on an IPv6 socketinstead of an IPv4 one. This parameter and the listen parameter are mutuallyexclusive.

# listen_ipv6=YES

#

Allow anonymous FTP? (Beware-allowed by default if you comment this out)

Anonymous_enable=NO

#

Uncomment this to allow local users to log in.

Local_enable=YES

#

Uncomment this to enable any form of FTP write command.

Write_enable=YES

#

Default umask for local users is 077. You may wish to change this to 022 Magna if your users expect that (022 is used by most other ftpd's)

Local_umask=022

Dirmessage_enable=YES

Use_localtime=YES

#

Activate logging of uploads/downloads.

Xferlog_enable=YES

#

Make sure PORT transfer connections originate from port 20 (ftp-data).

Connect_from_port_20=YES

Access.

Secure_chroot_dir=/var/run/vsftpd/empty

#

This string is the name of the PAM service vsftpd will use.

Pam_service_name=ftp

#

This option specifies the location of the RSA certificate to use for SSLencrypted connections.

Rsa_cert_file=/etc/ssl/private/vsftpd.pem

2. Configuration

Root@myserver-ftp:~#groupadd scan1

Root@myserver-ftp:~#useradd-G scan1-d / home/scan1-M ftpscan

Root@myserver-ftp:~#useradd-G scan1-d / home/scan1-M ftpscan2

Root@myserver-ftp:~#chown ftpscan:ftpscan / home/scan1/

Root@myserverftp:~# chmod-R 755 / home/scan1/

Root@myserverftp:~# fdisk-l

Root@myserverftp:~# blkid / dev/sda5 found UUID

Root@myserverftp:~# vi / etc/fstab

UUID=d71005bf-3bd2-46d6-a7be-3af47f76fad3 / home/scan1 ext4 defaults 0 2

3. The solution of 530 Login incorrect error

1. The solution to the 530Login incorrect error prompted by vsftp

You just need to put the

Auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed

If this sentence is commented out, it will be OK. Add a # in front. Okay.

Restart the vsftpd service. Problem solving

4. Configuration of dual network cards

Root@myserver-ftp:/etc# vim / etc/network/interfaces

Auto lo

Iface lo inet loopback

Auto etho

Iface lo inet loopback

Auto eth2

Iface lo inet loopback

Up route add-net 192.168.0.0 netmask 255.255.0.0 gw 192.168.23.1

Up route add-net 10.0.0.0 netmask 255.255.0.0 gw 10.0.16.1

Root@myserver-ftp:~# route delete default

Root@myserver-ftp:~# route add-net 192.168.0.0 netmask 255.255.0.0 dev eth0

Root@myserver-ftp:~# route add-net 10.0.0.0 netmask 255.0.0.0 dev eth2

Root@myserver-ftp:~# route add-net 192.168.0.0 netmask 255.255.0.0 gw 192.168.23.1

× × ×

2017 12 TEST UBUNTU 16.0

Root@myserverftp:~# sudo apt-get install vsftpd

Root@myserverftp:/home/myserver# sudo service vsftpd restart

Step 2: create a new directory / home/scan1/ as the user's home directory

Sudo mkdir / home/scan1/

Root@myserver-ftp:~#groupadd scan1

Step 3: create a new user uftp, formulate the user's home directory and the shell used, and set the password

Root@cmk-GA-880GM-D2H:/home# useradd-G scan1-d / home/scan1/-M mis-s / bin/bash

Root@cmk-GA-880GM-D2H:/home# passwd mis

Enter the new UNIX password:

Type the new UNIX password again:

Passwd: password changed successfully

Root@cmk-GA-880GM-D2H:~# useradd-G scan1-d / home/scan1/-M mis2-s / bin/bash

Root@cmk-GA-880GM-D2H:~# passwd mis2

Enter the new UNIX password:

Type the new UNIX password again:

Passwd: password changed successfully

Step 4: create a new file / etc/vsftpd.user_list to store users who are allowed to access ftp:

Root@cmk-GA-880GM-D2H:/home# vi / etc/vsftpd.user_list

Mis

Mis2

Root@cmk-GA-880GM-D2H:/home# vi / etc/vsftpd.conf

Run standalone? Vsftpd can run either from an inetd or as a standalonedaemon started from an initscript.

Listen=YES

#

Run standalone with IPv6?Like the listen parameter, except vsftpd will listen on an IPv6 socketinstead of an IPv4 one. This parameter and the listen parameter are mutuallyexclusive.

# listen_ipv6=YES

#

Allow anonymous FTP? (Disabled by default)

Anonymous_enable=NO

#

Uncomment this to allow local users to log in.

Local_enable=YES

#

Uncomment this to enable any form of FTP write command.

Write_enable=YES

#

Default umask for local users is 077. You may wish to change this to 022 Magna if your users expect that (022 is used by most other ftpd's)

Local_umask=022

Activate directory messages-messages given to remote users when theygo into a certain directory.

Dirmessage_enable=YES

#

If enabled, vsftpd will display directory listings with the timein your local time zone. The default is to display GMT. Thetimes returned by the MDTM FTP command are also affected by thisoption.

Use_localtime=YES

#

Activate logging of uploads/downloads.

Xferlog_enable=YES

#

Make sure PORT transfer connections originate from port 20 (ftp-data).

Connect_from_port_20=YES

#

This option should be the name of a directory which is empty. Also, thedirectory should not be writable by the ftp user. This directory is usedas a secure chroot () jail at times vsftpd does not require filesystemaccess.

Secure_chroot_dir=/var/run/vsftpd/empty

#

This string is the name of the PAM service vsftpd will use.

Pam_service_name=vsftpd

Userlist_file=/etc/vsftpd.user_list

# userlist_enable=YES

# userlist_deny=NO can directly jump out of the login console.

#

This option specifies the location of the RSA certificate to use for SSLencrypted connections.

Rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem

This option specifies the location of the RSA key to use for SSLencrypted connections.

Rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key

Root@cmk-GA-880GM-D2H:~# chmod-R 755 / home/scan1/

Root@cmk-GA-880GM-D2H:~# chown-R mis:scan1 / home/scan1/

Root@cmk-GA-880GM-D2H:~# sudo service vsftpd restart

Note: you have permission to write for mis and for mis2 and dsc.

Method 2:

Root@cmk-GA-880GM-D2H:/home/scan1# chmod-R uprix. gendarrwx / home/scan1/

Root@cmk-GA-880GM-D2H:/home/scan1# ls-al

Note: mis has license rights, mis2 and dsc have license rights.

Root@cmk-GA-880GM-D2H:/home# sudo service vsftpd stop

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report