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

How to add FTP users and set permissions in Linux

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

Share

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

This article shows you how to add FTP users and set permissions in Linux. The content is concise and easy to understand. It will definitely make your eyes shine. I hope you can gain something through the detailed introduction of this article.

1. Environment: ftp is vsftp. The restricted user name is test. The restricted path is/home/test

2. Create user, command line state, under root user:

Run the command: "useradd -d /home/test test"//add the user test and specify the home directory of the test user as/home/test  

Run command: "passwd test"//Set password for test, enter same password twice after running  

3. Change the user's corresponding permission settings:

Run the command: "usermod -s /sbin/nologin test"//limit user test not telnet, only ftp  

Run command: "usermod -s /sbin/bash test"//user test returns to normal  

Run the command: "usermod -d /test test"//change the home directory of user test to/test  

4. Limit users to access only/home/test and not other paths

Modify/etc/vsftpd/vsftpd.conf as follows:

chroot_list_enable=YES

# (default follows)

chroot_list_file=/etc/vsftpd/vsftpd.chroot_list

Edit the content above

First line: chroot_list_enable=YES//restrict access to its own directory  

Line 3: Edit vsftpd.chroot_list. Find the chroot_list file according to the directory specified in the third line. (File names may vary slightly depending on host)

Edit vsftpd.chroot_list to add restricted users, one line per username

5. Restart the server

After changing the configuration file, don't forget to restart the vsFTPd server.

Run the command: /etc/init.d/vsftpd restart

6. Cloud Reminder If you need to allow users to modify passwords, but do not have telnet login system permissions:

Run the command: "usermod -s /usr/bin/passwd test"//user telnet will directly enter the encryption interface  

The above content is how to add FTP users and set permissions in Linux. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.

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