How to Make an AIX File Read Only
AIX is a proprietary version of Unix produced by International Business Machines (IBM). AIX is a console-style Unix, meaning that all operations are done in what is called a "terminal" screen on the computer monitor. The terminal is a black screen containing either white, amber or green text. To change a file to read-only on an AIX system, you must traverse the directory by typing commands that let you arrive at the file you desire to change. Once you are in the file directory, use the chmod (change mode) command to set permissions.
Instructions
-
-
1
Log in to the AIX system as system administrator. The user name used as system administrator on most AIX systems is "root." After entering the user name, press the "Enter" or "Return" key on the keyboard.
-
2
Enter your administrator password when the AIX system asks for it at the command prompt on the screen, then press the "Enter" or "Return" key on the keyboard.
-
-
3
Use the "cd" (change directory) command on the AIX system to manually go to the directory in which the file to be changed resides. The example file for this article will be a file named "find," located in the /usr/bin directory of the AIX system.
The full file path appears as follows: /usr/bin/find In the case of this example, type the following and press the "Enter" or "Return" key on the keyboard when finished: "cd /usr/bin" (without quotation marks).
-
4
Remove all write permissions of the file for all three entities. There are three entities who can read, write or execute a file on an AIX system: U (file owner), G (group) and O (all others). To remove write access for all of these for the example file "find" within the directory you are now in, enter the following and press the "Enter" or "Return" key on the keyboard when finished: "chmod ugo-w find" (without quotation marks).
-
5
Set the file for read-only access for those who are allowed to read the file. If only the owner of the file is allowed to read it, enter this command followed by pressing "Enter" or "Return" on the keyboard: "chmod u+r find". If only the owner and group are allowed to read the file, enter "chmod ug+r find". If you want everyone to be capable of reading the file, enter "chmod ugo+r find" or "chmod a+r find," followed by "Enter" or "Return" on the keyboard.
-
6
Check the file to ensure your changes were made. To look at a file with all of its permission information, enter the following at the command prompt and press "Enter" or "Return" on the keyboard when finished: "ls -la find". Look at the far-left of the line that results on your computer screen. If you want only the file owner to be able to read the file, the permission string should appear as follows: "r------". If you want only the owner and group to be able to read the file it should appear as follows: "r--r----". If you want everyone to be able to read the file it should appear as follows: "r--r--r".
-
1
Tips & Warnings
There are nine total permission dashes in a permission string. The first three are for "owner", the second three are for "group" and the last three for "everyone." The first dash in each group of three is the "read" (r) setting, the second dash in each group is the "write" (w) setting, and the last dash in each group is the "execute" (x) setting.
References
- Photo Credit Goodshoot/Goodshoot/Getty Images