Well, we decided to consider this question on example of proftpd. I could not say that this is very useful FTP sever, but its configuration syntax is very apache-like, so it is very easy to undertsand how system works and configure it. My post regarding configuration of Apache virtual hosts could be useful for understanding of concepts.
Fisrt of all we assume that:
- proftpd is running
- webspace (folder with web site) is already created
- assume that we adding webpace /srv/www/vhosts/itvictories to proftpd
Main config of proftpd is /etc/proftpd.conf. Syntax is like in Apache's config and we now just have to declare new virtual host for proftpd. It also could be done in main config file, as well as in one, which is connected with include directive.
First of all you have to create to entities:
- user, which will be responcible for webspace and will have ftp access to its folder
- group, which will contain all ftp users
It could be done with standard linux commands, but please pay attention to creation of a new user:
Option "-s /bin/false" in useradd command will disable remote login (with shell) capability for user. Aftewards, open file /etc/group with your favourite editor and edit user ftp-vhost-itvictories to group ftp-users
Group creation is not mandatory at all, but help you to structurize your infrastracture.
Somehow grant write permissions to created user. E.g. in a following way:
Now we came to point to declare virtual host in /etc/proftpd.conf or some included file. Add below section to your config:
This will grant permissions for use ftp-vhost-itvictories to access directory /srv/www/vhosts/itvictories in chrooted mode. So user will be unable to reach any other directory at the server.
Now restart your proftpd and your webspace will be available over ftp.
No comments:
Post a Comment