Linux add vsftp account and set directory permissions

Source: Internet
Author: User
Tags ftp login


Change all of the. php files under the store to the owner of FTPD
[Email protected] ~]# chgrp ftpd/store/*.php
[Email protected] ~]# chown ftpd/store/*.php

=========================== Add vsftp Account start===================================
View Linux Versions
[email protected]/]# cat Etc/issue
See if there are any installed vsftp on Linux
[Email protected]/]# find-name "VSFTPD"-print
[Email protected]/]# Rpm-qa|grep vsftp

111.47.0.249 root root
CMCC 123456 FTP Login

1. New user CMCC can only login FTP, not as a system user login, the default home directory for new users in/HOME/CMCC
[Email protected]/]# adduser-g ftp-s/sbin/nologin CMCC
[Email protected]/]# passwd CMCC

2. Specify home directory to user/var/tmp/cmcc1 cmcc1 123456
[Email protected]/]# adduser-d/var/tmp/cmcc1-g ftp-s/sbin/nologin cmcc1
[Email protected]/]# passwd CMCC1

//3. Limit FTP users to access their home directory only, not to return to the previous level directory into other directories
//chroot_local_user #是否将所有用户限制在主目录
[[email protected]/]# vim/etc/vsftpd/vsftpd.conf
Remove the comment symbol (' # ') for the following two lines of argument (' # ')//vim command/chroot find I edit ESC exit Edit: Wq save

chroot_list_ File=/etc/vsftpd/chroot_list//chroot_list_file=/etc/vsftpd/chroot_list #是否限制在主目录下的用户名单

4. Create the Chroot_list file under/ETC/VSFTPD:
[Email protected]/]# CD/ETC/VSFTPD
[email protected] vsftpd]# Touch chroot_list
[Email protected] vsftpd]# vim chroot_list
Then add the user name (one line) that needs to be restricted, such as:
Cmcc
Cmcc1
Save exit.

5. Restart Vsftp
[Email protected] vsftpd]# service vsftpd restart

6.userdel + users can delete FTP users
[Email protected]/]# Userdel CMCC1

7. If you need to allow the user to change the password, but do not have Telnet login system permissions:
Usermod-s/usr/bin/passwd CMCC//user Telnet will go directly to the change interface

Linux add vsftp account and set directory permissions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.