Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 26th, 2001, 04:41 AM
shantanuo shantanuo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Mumbai, India
Posts: 232 shantanuo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 12 h 29 m 22 sec
Reputation Power: 8
Write permissions to everyone

Hi
I want to allow write permissions to everyone on my website though its risky.
I use the command
chmod a+w *.*
It allows permission to the root files and not to files in the directories. Again, when I add a file, I have to use the same command again.
How do I apply write permission to all the directories and subdirectories?


Shantanu oak

Reply With Quote
  #2  
Old November 26th, 2001, 09:00 AM
yhcmarc's Avatar
yhcmarc yhcmarc is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Heemskerk, The Netherlands
Posts: 254 yhcmarc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 25 sec
Reputation Power: 7
chmod -R a+w *

chmod -R 666 * (the one I would use, it gives everyone rw rights, use 777 when you want to give everyone rwx rights)

Marc

Reply With Quote
  #3  
Old November 26th, 2001, 10:49 AM
shantanuo shantanuo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Mumbai, India
Posts: 232 shantanuo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 12 h 29 m 22 sec
Reputation Power: 8
Please explain -R and *

Hi,
Thanks a lot for telling me how to allow read, write permissions.
I typed the commands mentioned above.
Let me tell you, I am not an expert. So can you please explain me what this command stand for?
I typed
chmod -R 666 *
and I could not access my server.
then I typed
chmod -R 777 *
and I could access my server and I got the write permissions, (what I was looking for)

The Point is I need a bit guidance...

1. What does R stand for?
2. Does it mean that if I use only * instead of *.* it will be applied to all the directories?
3. In the first command mentioned above (666), it means read and write. Does it mean that unless the people have execute permissions they can't "read" the page?
4. What is the difference between read and execute rights?
5. After I have typed the command (for eg. -R 777 *) how can I go back to the default setting of my server?

(I do understand what these number stand for I referred to the site http://shantanuoak.com/unix/advance.htm for the same)

Thanks

Reply With Quote
  #4  
Old November 26th, 2001, 04:17 PM
yhcmarc's Avatar
yhcmarc yhcmarc is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Heemskerk, The Netherlands
Posts: 254 yhcmarc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 42 m 25 sec
Reputation Power: 7
ok -R stands for recursive, that means it gives any file or subdirectory those rights you give in the chmod command.

When you give rw rights to directory and all the files in it you cannot read the files unless you know the exact filename because you don't have the execute rights on that directory.

But do you need to give eveyone write rights on the files for your site, when you just give them read and execute (5) it will do.

the numbers in chmod , correct me if I'm wrong

1 execute
2 write
3 write + execute (1 + 2)
4 read
5 read + execute (4 + 1)
6 read + write (4 + 2)
7 read + write + execute (1 + 2 + 4)

the first number is the user, the second the primary usegroup, the third everyone else.

The difference between read and execute is exactly what the words mean, when you can read a file you can look at the contents of the file, when you can execute the file it means you can execute the file / script like it as a program (shell scripts for example)

* stands for everything, *.* stands for every file with a dot in it, maybe the dot will be interpreted by the shell as a replacement for any character (that's what a dot means in regular expressions)

maybe it's best for you if you give 755 to the directories and 766 to the files.

Marc

Reply With Quote
  #5  
Old November 26th, 2001, 09:58 PM
shantanuo shantanuo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: Mumbai, India
Posts: 232 shantanuo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 12 h 29 m 22 sec
Reputation Power: 8
Thank You

Dear Sir,
Thanks for teaching me the right (Programmer like) apporach.

Reply With Quote
  #6  
Old November 27th, 2001, 01:27 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> I typed chmod -R 666 * and I could not access my server.

When you do a recursive chmod to a directory, all the subdirs and files within it will become 666 in permission. For a directory to serve webpage when Apache is running as nobody, 755 should do just fine. But you wanted to allow everyone's CGI scripts write access, then you need to chmod those dirs 777. That said, chmod'ing a dir to 666 won't work anymore.

What you really should do is to chmod dirs to 777 and files to 666. To do this, run the following command:

find /path/to/that/dir -type d -exec chmod 777 {} \;

Then run the following command to chmod files (just files, not dirs) to 666:

find /path/to/that/dir -type f -exec chmod 666 {} \;

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Write permissions to everyone


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway