chmod Solves Problems

We can do a lot to keep our files protected with what we know already. Before we go on to another very important aspect of chmod, let’s take a look at a problem that we can already solve.

Here’s a listing of the contents of the directory /home/steve, which belongs to user steve in group sales.

-rw-------  steve  sales  customers.dat
-rwx------  steve  sales  summarize

The customers.dat file contains names, addresses, phone numbers, ages, and incomes of customers. The summarize program reads this file and prints a summary of customers, grouped by age and income. Steve clearly doesn’t want just anyone reading his confidential data, so he has used what he already knows about chmod to set up his permissions so that he is the only person who can read the confidential customer data or execute the program. Let’s see exactly what happens when Steve runs the program.

EventLinux says
Steve types summarize You are user steve.
You want to execute file /home/steve/summarize.
Permission granted.
Program begins. ---
Program asks to read file /home/steve/customers.dat You are user steve.
You want to read file /home/steve/customers.dat.
Permission granted.
<< Try chmod again Index A New Problem >>