Koozali.org: home of the SME Server

CHMOD directories and files

Xexenxy

CHMOD directories and files
« on: July 13, 2001, 04:25:03 PM »
Hello;

     How can I CHMOD directory and files from user admin and use CuteFTP connect to e-smith server?

Please help me how to config ..


thanks

Xexenxy

Andrew Roberts

Re: CHMOD directories and files
« Reply #1 on: July 16, 2001, 07:30:15 PM »
As a security feature, e-smith does not allow you to chmod files from ftp.  You could try using enabling ssh and using a a secure copy program (scp) like Winscp to transfer files and change permissions.

Jimbo

Re: CHMOD directories and files
« Reply #2 on: July 16, 2001, 07:33:38 PM »
Go to the directory where you wish to change the file permissions (on the e-smith server itself, so NOT via the console or a ftp client!)

And then the following will apply:

The basic format for chmod is chmod xyz file.foo. x, y, and z are each a number between 0 and 7. Each number represents the
permissions of a group - x is for the user that owns the file, y is for the group that owns the file (normally the user's group), and z is
for everybody else. To determine the actual values for each number, you use the following method: start with x = 0. If you want to
be able to read from the file, add four. x can be 0 or 4 at this point in time. If you want to be able to write to the file, add two. x can
now be 0, 2 (a write-only file??), 4 (read-only file), or 6 (read/write file). If you want to be able to execute the program, add one.
You now have a full range of possible numbers:

     Number  | Permissions
   ----------+---------------------------------------------------------------
       0     |   None - cannot read or write or execute
       1     |   Can execute, but cannot read or write
       2     |   Write-only, cannot read or execute (??)
       3     |   Write-able/executable
       4     |   Read-only, cannot write to or execute
       5     |   Read-only executable, cannot write to
       6     |   Readable Writeable file, but not executable (ie: text file)
       7     |   Readable Writeable Executable file - most programs are this
   

You use the same process to determine the number representing the permissions for the group that owns the file (y) and for the rest
of the world (z). It's typically a bad idea to chmod 777 any file, as it allows the world to replace the program with whatever they'd
like.

Note that root can mess with files however they darn well please. When root uses chmod on a file, the ownerships do not change,
but the permissions are changed. If you want to keep a user from accessing a file that they own, you must change the ownership to
root (or anyone else, for that matter). You can change ownership using chown.

Setting execute for a directory allows that directory to be read. That is, you can see what's in it. That is, if user does not have
execute permissions for dir/, when user does ls dir/, ls will return an error and not list the files in that directory.