LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-01-2008, 02:27 PM   #1
bsctov
LQ Newbie
 
Registered: Apr 2008
Posts: 13

Rep: Reputation: 0
Smile var/www Folder permission


When I connect to my webserver running apache though FTP (or even locally on the server) When I try to create a new file or delete a file or overwrite a file in root/var/www it wont let me and this is troublesome because this is where the website is located and I need to be able to access and change these files.

Im hoping you guys have one of those sneaky command lines to help me out here hehe.
 
Old 05-01-2008, 04:36 PM   #2
rockdw
Member
 
Registered: Nov 2002
Location: Chicago, IL
Distribution: Rasbian, Debian, Gentoo, RHEL
Posts: 65

Rep: Reputation: 21
I think we need a little more info

Well, for starters, I think some clarification of what you are trying to do would be helpful. Your description of how you are connecting to the server is not very clear. It sounds like you are trying to use ftp through your webserver, but that's not normally how you would access a site to update files.

What ftp app are you using?
Do you have normal login access to the server itself?
What about using something other than ftp (i.e. scp) instead?
 
Old 05-01-2008, 04:49 PM   #3
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 398

Rep: Reputation: 87
Quote:
Originally Posted by bsctov View Post
When I connect to my webserver running apache though FTP (or even locally on the server) When I try to create a new file or delete a file or overwrite a file in root/var/www it wont let me and this is troublesome because this is where the website is located and I need to be able to access and change these files.

Im hoping you guys have one of those sneaky command lines to help me out here hehe.
"chmod" changes permissions. Your ftp client can do it, or from the command line read "man chmod"

Possibly what you really want is "chown". The standard gotcha is the web server is probably running as a limited priviledge user www-data, so if the server gets hacked, the damage is contained.

One way is to give the www-data user a (good) passsword and ftp using the www-data username. I recommend pass phrases rather than passwords. eg. "I hate battling ownerships and permissions" is a passphrase you can store in your head. Change that to a password by picking the first letters.... "ihboap" and maybe throwing in a number or two "1hb0ap".
 
Old 05-01-2008, 05:32 PM   #4
bsctov
LQ Newbie
 
Registered: Apr 2008
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rockdw View Post
Well, for starters, I think some clarification of what you are trying to do would be helpful. Your description of how you are connecting to the server is not very clear. It sounds like you are trying to use ftp through your webserver, but that's not normally how you would access a site to update files.

What ftp app are you using?
Do you have normal login access to the server itself?
What about using something other than ftp (i.e. scp) instead?
Im just trying to use a FTP to change/edit my website files, its currently setup with Gproftpd with the webserver root as the user access root.
 
Old 05-03-2008, 11:15 AM   #5
Gryyphyn
Member
 
Registered: Dec 2006
Location: Ogden, UT (Go OALUG!)
Distribution: OpenSuSE 10.1
Posts: 61

Rep: Reputation: 15
again...

Quote:
Originally Posted by bsctov View Post
Im just trying to use a FTP to change/edit my website files, its currently setup with Gproftpd with the webserver root as the user access root.
As cyent said: it sounds like a permissions issue. The account that you're using to log in for ftp needs to have permissions to access/modify files in the /var/www dir to make any changes. There's a couple ways you can do this that I've worked with:

Change the ownership of the directory to the user/group you're using for ftp access.

Leave the default ownership in place and append the www ftp groups to the user account you're using for ftp/www access.

Change the permissions of the dir to allow lax/open access (BAD IDEA!).

Personally I'd start with adding the groups to your username: it's more secure, doesn't remove access to the dir from other priveleged accounts and should allow you the editing capacity you're looking for. Under no circumstances, however, should you switch ownership/permissions to the base 'user' groups: it's extremely unsecure in comparison to the other two methods.

Gryyphyn, out.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I give a user permission to save files to /var/www/html? rotnay6000 Linux - Newbie 10 07-14-2009 08:45 PM
Permission problem pasting content to the var/www/html folder bluetxxth Fedora 2 10-01-2007 10:53 AM
Whenever I create a file in /var/www/html/, it is at permission 600 (forbidden) Josh1billion Linux - Software 4 03-18-2006 10:24 PM
Creating VSFTPD Full permission User to /var/www/html vibin Linux - General 5 01-03-2006 02:32 AM
VSFTPD /var/www mmethe Linux - Software 2 05-10-2005 04:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration