linux acl interview questions

What is the difference between SUID and SGID?

In computing, umask is a command that determines the settings of a mask that controls which file permissions are set for files and directories when they are created. It also refers to a function that sets the mask, and to the mask itself, which is formally known as the file mode creation mask.

What is the default umask value for useradd command and where is it defined?

Default umask value for useradd: 077

Modifying ACL using setfacl : To add permissions for a user (user is either the user name or ID):

Observe the difference between output of getfacl command before and after setting up ACL permissions using setfacl command. There is one extra line added for user mandeep which is highlighted in above.

From Linux man pages, ACLs are used to define more fine-grained discretionary access rights for files and directories.

Observe the first command output in , there is extra “+” sign after the permissions like -rw-rwxr–+, this indicates there are extra ACL permissions set which you can check by getfacl command.

Using Default ACL : The default ACL is a specific type of permission assigned to a directory, that doesn’t change the permissions of the directory itself, but makes so that specified ACLs are set by default on all the files created inside of it. Let’s demonstrate it : first we are going to create a directory and assign default ACL to it by using the -d option:

Watch this Linux Interview Questions And Answers Video on YouTube:

Linux is an open-source operating system based on UNIX. It was named after the founder “Linus Torvalds”. He introduced Linux with the primary goal to offer an operating system at a free or very reasonable price for users. It is based on the Linux kernel and is compatible with different hardware platforms such as Intel, MIPS, HP, IBM, SPARC, and Motorola hardware platforms. Linux’s mascot, a penguin named Tux, is another popular feature. Linux offers a user-friendly environment where they can easily modify and create variations in the source code.

FAQ

Why ACL is used in Linux?

ACLs allow us to apply a more specific set of permissions to a file or directory without (necessarily) changing the base ownership and permissions. They let us “tack on” access for other users or groups.

How do you check ACL rules in Linux?

Use the ‘getfacl’ command for viewing ACL on any file or directory.

How do I use ACL for directory in Linux?

From Linux man pages, ACLs are used to define more fine-grained discretionary access rights for files and directories. setfacl and getfacl are used for setting up ACL and showing ACL respectively. Observe the difference between output of getfacl command before and after setting up ACL permissions using setfacl command.

How do I check ACL permissions in UNIX?

To display details ACL information of a file use the getfacl command. Notice the 3 different user: lines. The first line lists the standard file permissions of the owner of the file. The 2 other user permissions are the individual permission for the user john and sam.

Related Posts

Leave a Reply

Your email address will not be published.