Pages

Banner1

Tuesday 20 June 2017

How to create a FTP user with specific /dir/ access only on a Centos / linux installation

I currently have SFTP access to the server via my root user, but am now trying to create a new user with FTP access to a specific directory only on the server, I've done the following:

Before that, please check and confirm 'vsftpd' service already installed. you can check those using below commands.

 #sudo yum install httpd
Now, below commands for new user creation with different home directory.

1. mkdir /var/www/mydomain.com
2. mkdir /var/www/mydomain.com/html
3. useradd <-username>
4. passwd <-username>
5. chown –R <-username> /var/www/mydomain.com
5. groupadd <-groupname>
6. gpasswd -a <-username> <-groupname>
7. chgrp -R <-groupname> /var/www/mydomain.com
8. chmod -R g+rw /var/www/mydomain.com
You have to add the following option on the vsftpd.conf file

chroot_local_user=YES

No comments:

Post a Comment

Exciting Offer