Securing Systems with Users, Groups, and Permissions The second field is for where the policy applies We have so far used ALL=(ALL) to specify everything In the first part of this field, we can define
a group of computers to be run, such as SERVERS In the second part, we can specify commands such as NETWORK=/usr/sbin/ip.
Between parentheses is the user account that can be used to run the command The third field is to specify which commands will use the password and which won’t.
The syntax goes as follows:
user hosts = (run-as)
commandsLet’s see an example:
Runas_AliasDB = oracle
Host_Alias SERVERS=10.0.0.0/255.255.255.0
Cmnd_Alias NETWORK=/usr/sbin/ip pete SERVERS=NETWORK
julia SERVERS=(DB)ALL
We have already seen how to provide administrative access to users in RHEL and even how to do it in a very granular manner. Let’s move on now to the section on working with file permissions.
Checking, reviewing, and modifying file permissionsSo far, we have learned how to create users and groups and even provide administrative capabilities to them. It’s now time to see how permissions work at the file and directory level.
As you’ll remember, in Chapter 3, Basic Commands
and Simple Shell Scripts, we already saw how to seethe permissions that are applied to a file. Let’s review them now and dive deeper.
Let’s get the permissions info for some example files by listing it with l, for the long option. Remember to run this as the root user (or using sudo):
Share with your friends: