Control Linux users can use FTP connection to specify directory, and cannot connect with SSH

Source: Internet
Author: User
Tags ftp connection

There are two versions, on-line version I tried not to, later I touched out another feasible:

The first is the online version:

#mkdir/home/ftp #创建ftp根目录
#useradd-D/home/ftp-s/sbin/nologin ftpuser #创建用户 (note home directory and non-login)
#passwd Ftpuser #设置用户密码
#chown-R ftpuser/home/ftp
#chmod 755-r/home/ftp #改变ftp根目录属主和权限
#echo "Ftpuser" >>/etc/vsftpd.user_list #把ftpuser加入到允许访问的队伍 my version: To create an FTP user first: useradd-d/hom E/ftp Ftpuser then create the password: passwd ftpuser Add a login to the/etc/ssh/sshd_config account, if you only allow root login to write: Allowusers root your FTP account, did not write up, Of course, you are not allowed to log in with SSH. At this time add Ftpuser to/etc/vsftpd/chroot_list, then you use Ftpuser login FTP can only access you create the designated/HOMT/FTP directory.

Control Linux users can use FTP connection to specify directory, and cannot connect with SSH

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.