LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Tags used in this thread
Popular LQ Tags , , ,

Reply
 
Thread Tools
Old 08-24-2009, 03:25 PM   #1
erjohnson227
LQ Newbie
 
Registered: Aug 2009
Location: California
Posts: 3
Thanked: 0
Linux Read only attribute (undoing this in terminal)


[Log in to get rid of this advertisement]
So heres the deal. Please excuse me as i am used to dos based commands and do not know the first thing about unix commands. I have apache running on Ubuntu 9.04 and the default folder is /var/www . now what is the command i can type into terminal to make this folder read/write instead of read only. (NOTE) i cannot change the attributes of this folder through the GUI because although i created this computer it says i dont have root access. So i figured it would be faster to just use the SUDO command.
windows_98_nt_2000 erjohnson227 is offline  
Tag This Post , , ,
Reply With Quote
Old 08-24-2009, 04:04 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 2,914
Thanked: 271
Unix/Linux permissions are not as simple as those in DOS. If my memory serves correctly (though admittedly it's been a long time since) DOS uses a simple scheme with three attributes for each file: read, write and hidden. There's no exec permission, since both DOS and Windows determine if a file is a program based on its extension.

In Linux you have much more than that. The basic ones that should worry about are the read, write and exec permissions, but these are defined in three triplets: read (+r), write (+w) and exec (+x) for the owner of the file; read, write and exec for the group; and read, write and exec for the rest of persons. Also, the exec permission on directories mean "access". So you can't cd to a dir if you don't have the +x permission over it for your user. All this info can be seen with "ls -l" (or -ld for directories), for example, in /var/www you should have something similar to this:

Code:
$ ls -ld /var/www/
drwxr-xr-x 3 apache root 4,0K oct 29  2008 /var/www/
This means that the owner of the file is the user "apache", it's the ID under which the apache server usually runs. The group is "root", the permissions are "rwxr-xr-x", which means "rwx" for the user apache, "r-x" for all the users which belongs to the group "root", and "r-x" for the rest of the users. These are usual permissions for a web.

To set a permission you use chmod. For example, to set write permissions for everyone you would do "chmod a+w /var/www" (I hihgly advise against that). "a" means all, "+w" means to set write permissions. After that, to remove the write permissions again from "group" and "others" you would use these two commands: "chmod g-w /var/www" and "chmod o-w /var/www", where "g" is "group" and "o" is "others", and "-w" is to remove write permissions.

So, first, you need to decide what do you mean when you say that you want to give read and write permissions to /var/www. It really shouldn't be world-writable, this would have many security implications, unless you are only serving it locally in a trusted intranet and can't be reached from the outside. And even then, there's no reason to use a so poor security policy.
linuxgentoo i92guboj is online now     Reply With Quote


Thanked by:
Old 08-25-2009, 02:32 PM   #3
erjohnson227
LQ Newbie
 
Registered: Aug 2009
Location: California
Posts: 3
Thanked: 0

Original Poster
thank you very much for the fast reply. that did the trick, the "chmod" command made the files writable so i now have full access to my apache document folder.
windows_98_nt_2000 erjohnson227 is offline     Reply With Quote


Old 08-25-2009, 05:33 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 2,914
Thanked: 271
Again (and feel free to igonre me if you already know this, but it's important), you shouldn't be doing that if the web server is exposed to the public. You are granting *everyone* around the world the permission to write in your web server.
linuxgentoo i92guboj is online now     Reply With Quote


Old 08-26-2009, 12:04 AM   #5
erjohnson227
LQ Newbie
 
Registered: Aug 2009
Location: California
Posts: 3
Thanked: 0

Original Poster
how would i remotely write to my server? ive got it up and running now and was wondering about how to set up FTP so that i can remotely upload files from another authorized computer
windows_98_nt_2000 erjohnson227 is offline     Reply With Quote



Reply

Bookmarks


Thread Tools

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
sysfs read access on attribute -> output buffer donhuansohn Programming 0 07-15-2009 09:44 PM
What is the system call of getting the terminal attribute? henry0712 Programming 2 01-02-2007 01:06 PM
remove read only attribute in user's directory dsholden Linux - Newbie 5 09-14-2005 06:10 PM
Samba config to allow Windows read-only file attribute changes percheron Linux - Networking 8 09-13-2003 12:56 AM


All times are GMT -5. The time now is 02:12 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration