Unix/Linux Go Back    

Debian Debian GNU/Linux is a free distribution of the GNU/Linux operating system.

Help request. FTP user to var/www/html


Thread Tools Search this Thread Display Modes
Old Unix and Linux 02-04-2013   -   Original Discussion by Pinkfloyd
Pinkfloyd Pinkfloyd is offline
Registered User
Join Date: Feb 2013
Last Activity: 4 February 2013, 6:24 AM EST
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Help request. FTP user to var/www/html

Hi all.

I appologise this is my first post, I will gladly have a further look around to see if this has been posted elsewhere, but so far it has not, or it doesnt quite explain in full what I need. If anyone here can help me out, I would really appreciate this. I want to make sure I do this right, as in the past I made a huge error and messed up my server. Linux Linux

I have two servers.

1, is our online dedicated server for mainly gaming, but I also use it as a hosting site for very basic webpages and a forum. This is on Centos 5.
2, My second server is a raspberry PI which I am using to test and learn from which is on Debian at home. Both servers are setup with just CLI access and Webmin.

I fully understand that these are two very different distro's but I am hoping what I need to do, can apply to both. All I want to be able to do is create a user, which has full read/write access ( and also be able to change a subfolder's acess ( to 777 for example ) to the var/www ( PI ) or var/www/html ( Centos ) folders using a client FTP application from a Windows PC, such as Filezilla.

As an example from my Raspberry PI, I wanted to try this from root:

chown -R piweb:piweb /var/www/

I assume, this on Centos would be :

chown -R webuser:webuser /var/www/html

But im not so sure if this is right, or if there is a better way to do it? Any help would be great, thanks for your time.


Last edited by Pinkfloyd; 02-04-2013 at 07:24 AM..
Sponsored Links
Old Unix and Linux 02-09-2013   -   Original Discussion by Pinkfloyd
Azrael's Unix or Linux Image
Azrael Azrael is offline
Registered User
Join Date: Sep 2011
Last Activity: 13 October 2017, 8:45 AM EDT
Posts: 141
Thanks: 56
Thanked 3 Times in 3 Posts
From the man page on chown:

-R, --recursive
operate on files and directories recursively
This means you gave ownership privledges to "piweb" and "webuser" to /var/www and all its sub-directories. If this is what you are trying to accomplish.

To check which user owns the files use this:

ls -l

This will show the user who owns the files in the current directory.

The syntax you have used is correct for Debain and CentOS. However, you can shorten this by using this:

chown -R piweb. /var/www/

Instead of:

 chown -R piweb:piweb /var/www/

If you need to change permissions on files or directories you will need to use chmod instead of chown. I should warn you that using 777 permissions on a file viewable to the web is very dangerous. You would be giving the entire Internet read, write, and execute permissions on these files which is a huge security risk. I would strongly suggest using 755 or 644 permissions instead which should allow you the same functionality, but with better security.

If you want full read, write, and execution access remotely it would be far safer to use SSH or VNC with a user and then login to root. However, for the purposes of FTP this you should be fine with just using 755 and 644.

Last edited by Azrael; 02-09-2013 at 12:41 PM.. Reason: Emote tranucated my text
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to protect directory var/www in debian? azzeddine2005 UNIX for Dummies Questions & Answers 6 12-03-2012 01:44 PM
Permissions of the folder var/www aneuryzma UNIX for Dummies Questions & Answers 4 09-21-2010 09:01 PM
var/www/html permissions JPA Web Programming 0 12-24-2009 08:51 AM
New SEO Experiment http://www.globalfactbook.com/index.html Neo Web Programming 1 07-14-2008 12:03 PM
resize /var/www (debian) seagonus UNIX for Advanced & Expert Users 3 12-17-2007 08:36 AM

All times are GMT -4. The time now is 02:52 AM.