Create a new ftp user in Linux system

1. Create a new user "test1"

  1. Create a new user "test1" and set the user directory to "/usr/testDir/"
  2. Set the login password for user "test1"
[root ~]# useradd -d /usr/testDir/ test1

[root ~]# passwd test1
更改用户 test1 的密码 。
新的 密码:
passwd:所有的身份验证令牌已经成功更新。
[root ~]#

2. Open the "/etc/vsftpd/vsftpd.conf" file and set the following parameters

chroot_local_user=YES


pam_service_name=vsftpd
userlist_enable=YES
userlist_file=/etc/vsftpd/user_list
userlist_deny=NO

allow_writeable_chroot=YES
pasv_min_port=30000
pasv_max_port=31000

Insert image description here

3. Navigate to "/etc/vsftpd/", open the "user_list" file, and add user "test1"

Insert image description here

4. Restart the ftp service

[root ~]# systemctl restart vsftpd

5. Use ftp client software to access the ftp server

Insert image description here

6. Upload files to the ftp server to change the directory (it will fail!!!)

Failed to upload file (response : 553 Could not create file .)

Reason: The current ftp operation user does not have write permission for the folder on the remote server! ! ! ! Need to modify the folder operation permissions of the current user in the liunx system

Insert image description here

7. Modify the root path "/usr/testDir" permissions of user test1

Insert image description here

8.Upload the file again after modifying the permissions

Insert image description here

9. View the folder information of user test1Insert image description here

Guess you like

Origin blog.csdn.net/qq_37959253/article/details/128570506