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

The process of CentOS installing vsftp and building new users

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly explains "the process of CentOS installing vsftp to build new users". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the process of CentOS installing vsftp and building new users".

Rpm-qa | grep vsftpd to see if vsftp is installed

Run the command to start the installation

Yum-y install vsftpd

Centos automatically downloads and installs.

After installation

Set to run automatically every time you turn it on

Chkconfig vsftpd on

Start by hand

Service vsftpd start

You can use netstat-tl to see if you are listening on port 21.

Build new users

# useradd-d / var/www-g ftp-s / sbin/nologin myftp

Description:

-s / sbin/nologin is to prevent it from logging into the system.

-d specifies that the user directory is / var/www, which can be replaced with any directory you need.

-g ftp adds users to the ftp group (vsftp has been created)

Myftp is the ftp user name. Change this myftp to your ftp user name when configuring.

After executing the command, if an error message appears:

Useradd: warning: the home directory already exists.

Not copying any file from skel directory into it.

This means that the user's directory already exists (/ var/www, this can be any directory you set). You can no longer create this directory. It is not a failure to add a user and can be ignored.

Special reminder: if the user established with useradd does not add the-s / sbin/nologin parameter, the established user is an ordinary system user and has the right to log in to the CentOS server, which is very dangerous in the virtual host environment. So add the parameter-s / sbin/nologin after the useradd command to add a special ftp account (virtual account) for the centos server virtual host that cannot log in to the system.

Set password

# passwd myftp

Tip: repeat 2 times

Modify / var/www directory properties: (or any self-defined directory)

# chown-R myftp / var/www recursively sets the owner of all directories and files as the newly added ftp user

# chmod-R 755 / var/www recursively sets all rights of the advocate, and other users only have read and execute permissions

In this way, if the site needs write permission to run, it can be modified directly through the user name of ftp.

Configuration file / etc/vsftpd/vsftpd.conf

Setting an account can only access its own directory, that is, the directory set when the user is created above-d / var/www

Chroot_local_user=yes

Restart the vsftpd service

# service vsftpd restart

At this point, I believe you have a deeper understanding of "the process of CentOS installing vsftp to build new users". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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