Results 1 to 2 of 2
Thread: Changing Permissions in Unix
2001-08-21, 13:14 #1kennyritchGuest
Changing Permissions in Unix
Hope you can help ...
Basically, I've been using Dreamweaver to FTP files to my server but I've been experiencing a number of 550 Permission Denied errors lately. I contacted our server company and they said that Dreamweaver has possibly changed permissions on some of my directories. So my question is how do I check AND change permissions on these directories?
I use SSH to connect to my server, I have full access rights and I have a feeling I need to use the chmod command. However I am VERY new to Unix so you'll need to be nice to me!!
2001-08-21, 14:39 #2
- Join Date
- Aug 2001
- Thanked 0 Times in 0 Posts
Re: Changing Permissions in Unix
You are right about chmod, although chown and chgrp might get involved.
There are two ways to drive chmod, they both have the format:
chmod <permissions> <filespec>
the difference is the way the permissions are specified. I only know the numerical way, there is a character based method, but I get confused by it. See the man page (man chmod) for details.
The numerical way is this, in a directory listing with the -l switch (that is a lower case L), the lines look like this:
-rw-r--r-- 1 Administ None 4876767 Aug 16 09:40 an11.ps
the -rw-r--r-- section is the permissions. The first character is the special column, then the next three are read write and execute for the owner, then next three are read, write and execute for the group, the last three are read write and execute for everyone. I cannot remember what the 1 means, then we have owner (Administ) and group (None), then size, date and name.
To set the special flag you need to use the character based method, but you rarely need that.
To set the rwx sections, think like this:
r=4, w=2, x=1
For each set of three, add up the value of the letters that you want set, string these numbers together. In the example above, this would be 644.
Thus to change it to read and write for everyone, you would use:
chmod 666 an11.ps
of course, the filespec can use wildcards as well, and can usually be a list of files.
You could try
chmod 446 an11.ps
but that would be a little pointless (giving everyone more privs than the owner, since the owner is also part of everyone)
Note that directories need to have the x bit set for the contents to be listed, and the r bit set to navigate through them. For public ftp directories 755 is usual.
chown and chgrp are used to change the owner and group of the file, for example:
chown Administ *.ps
but these are often not available on systems that have quotas enabled, otherwise you can "give" big files to other people and fill their quota up.
Hope that helps.