homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

Setting up an FTP user account and permissions
FTP user permissions

5+ Year Member

Msg#: 3298509 posted 2:43 pm on Mar 31, 2007 (gmt 0)

Setting up an FTP user account and permissions

Ok I have my virtual servers working under Apache 2 on an old P3 running Ubuntu Server. I have my router set-up so that my URL points to it. Fantastic! I am hosting my own website! The problem comes when I set-up Dreamweaver on my Windows machine (my chosen development environment) for FTP to my Apache box. Now I am still learning Linux so forgive my thickness. I set-up my user as follows:-

briansnr@ubuntu:/etc/apache2$ sudo useradd -m -d /var/www/my-site -g www-data bristolcar-vanhire
briansnr@ubuntu:/etc/apache2$ sudo passwd my-site

This works fine, in that I can now use FTP to login as my-site. But anything I FTP has the wrong permissions as such

-rw------- 1 my-site www-data 26352 Mar 31 14:43 index.html

Now I have found I can fudge things by post FTP issuing;

sudo chmod g+rx my-site -R

on the my-site directory. Which works. But there must be a correct way of doing this, and as yet I have been unable to find out what it is.

Mega thanks in advance to anyone who can help me out with this :)



WebmasterWorld Senior Member encyclo us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 3298509 posted 7:17 pm on Mar 31, 2007 (gmt 0)

The best way of organizing multiple virtual hosts is to create a user for each site, then host the site in the home directory of the user.

For example, you have site alpha and beta, both hosted on the same server. You create a user account for each site, eg.:

# adduser alpha

You will have a home directory for each, and you can create a public_html directory within it for the site. So alpha would be hosted in:


Then you can use user alpha's FTP account to connect and upload the site, and the files will have the permissions of user alpha instead of www-data.

From there, you can alter you virtual hosts in httpd.conf to include a ScriptAlias for each virtual host, and then you can keep cgi scripts in:


This is a rough guide, but hopefully you should get the idea. For site beta, the situation is the same, and you can keep the FTP accounts within each site's home directory.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved