Bruce Knox    Database Programmer/Analyst                                                                        date last updated 06/26/07

 

Elegant but Confusing UNIX file permissions. 
 
Here is what you need to know to work with Banner.
Most likely, you will want to use one of three permissions:
  
chmod 644 filename for SQL*Plus scripts.
chmod 755 filename for UNIX scripts run by others.
chmod 700 filename for UNIX scripts run by cron and you only.
 
The logic behind these choices follows:
 
ls -l (dash lowercase L) will list the file permissions.  
 
ls -1 (dash one) will not.
 
For example:
 
ls -l fn
 -rwxrwxrwx . . . fn where fn is the filename.
 
The initial "-" indicates that fn is a file.  It would have been a "d" for a directory.
 
The three groups of rwx are for owner, group, and others permissions.
Each rwx group represents:
 
  r   Read
  |w  Write 
  ||x eXecute
  ||| 
0 --- none
1 --x
2 -w-
3 -wx
4 r--
5 r-x
6 rw-
7 rwx
 
With the chmod command, one digit entered for each of owner, group, and others becomes three letters (shown by ls -l) for each.
 
If the pattern is not obvious, just note that:
 
0 for none 
1 for eXecute 
2 for Write 
4 for Read 
 
can be summed to the number of any combination needed.
 
5 is Read and eXecute because 4 (Read) and 1 (eXecute) sum to 5.
7 is Read, Write, and eXecute because 4 (Read), 2 (Write), and 1 (eXecute) sum to 7.
 
Some useful examples:
 
chmod 700 fn will give Read, Write, and eXecute permissions only the owner of file fn.
ls -l fn
-rwx------ . . . fn      Note that cron can also eXecute this file.
chmod 666 fn will give Read and Write permission to everyone.
ls -l fn
-rw-rw-rw- . . . fn
 
chmod 644 fn will give Read and Write to the owner and Read-Only to everyone else.
ls -l fn
-rw-r--r-- . . . fn
 
chmod 755 fn will give Read, Write, and eXecute to the owner and Read/eXecute to everyone.
ls -l fn
-rwxr-xr-x . . . fn
 
permissions:  (You need a fixed width font such as Courier to use the following table.)
 
For each of owner, group, and others:
  
0 (                            ) 0 none
1 (                   1 eXecute)
2 (         2 Write            )
4 (4 Read                      )
 
5 (4 Read +           1 eXecute)
6 (4 Read + 2 Write            )
7 (4 Read + 2 Write + 1 eXecute)
  
For example,
 
chmod 777 fn
ls -l fn
-rwxrwxrwx . . . fn
 
7 (4 Read + 2 Write + 1 eXecute) for owner|group|others
 
chmod 755 fn
ls -l fn
-rwxr xr x . . . fn 
 
7 (4 Read + 2 Write + 1 eXecute) for owner
5 (4 Read +           1 eXecute) for group|others
 
chmod 644 fn
ls -l fn
-r-xr--r-- . . . fn
  
6 (4 Read + 2 Write            ) for owner
4 (4 Read                      ) for group|others
 
 
Oracle SQL*Plus scripts are Read by SQL*Plus not eXecuted by UNIX.  Use chmod 644
To eXecute a UNIX script you must also be able to Read it.   Use chmod 755
See IBM's AIX documentation website for more details: IBM AIX (see chmod).
 

Use this information and these scripts at your own risk. As a condition of using these scripts and information from this site, you agree to hold harmless both the University of Arkansas Cooperative Extension Service and Bruce Knox for any problems that they may cause or other situations that may arise from their use, and that neither the Extension Service nor I will be held liable for those consequences.  The scripts and information are provided "as is" without warranty, implied or otherwise.  Limitation of liability will be the amount paid to the University of Arkansas specifically for this information. (It was free:)

 

  

Hit Counter   visits

 

http://www.uaex.edu/bknox/permissions.htm