Tuesday, June 7, 2016

centos - How do I restrict created users to a directory and disable SSH for VSFTPD

I've been googling for my answers for a good few hours and I can't seem to get a direct answer to my questions. I have found many tutorials but many are vague.



Anyways:




I've recently setup VSFTPD on my server. I'm running CentOS 6.4 (if that makes any difference). I have created the user 'test' using useradd and it can login successfully (with SSH and FTP) However this is what I'm looking to do:



Create users (with useradd) to use with VSFTPD and disable SSH for them. With these user(s) restrict them to their web directory (e.g. /var/www/domain/example.com) so they can login with FTP and upload, edit, delete and create directories with in the example.



For reference this is my configuration file:





anonymous_enable=NO





local_enable=YES



write_enable=YES



local_umask=022



dirmessage_enable=YES




xferlog_enable=YES



connect_from_port_20=YES



xferlog_std_format=YES



chroot_local_user=YES chroot_list_enable=YES



listen=YES




pam_service_name=vsftpd userlist_enable=YES tcp_wrappers=YES




Many thanks. Apologises if my explanation isn't descriptive enough. I'm not sure how to word it.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...