Exam 101-500 All QuestionsBrowse all questions from this exam
Question 9

Consider the following directory:

drwxrwxr-x 2 root sales 4096 Jan 1 15:21 sales

Which command ensures new files created within the directory sales are owned by the group sales? (Choose two.)

    Correct Answer: A, E

    To ensure new files created within the directory 'sales' are owned by the group 'sales', you can use 'chmod g+s sales' and 'chmod 2775 sales'. The command 'chmod g+s sales' sets the group ID on the directory, so files created inside will inherit the group ownership. The command 'chmod 2775 sales' sets the permissions explicitly, ensuring the setgid bit is applied, which also ensures new files inherit the directory's group ownership.

Discussion
GoenaOptions: AE

A and E is correct.

dump_deltaOptions: AE

A. chmod g+s sales E. chmod 2775 sales

mrfstopOptions: AE

A. chmod g+s sales This command sets the sticky bit (s) for the "sales" directory. The sticky bit ensures that only the owner of a file (or root) can delete or rename it, even if they belong to a different group. Additionally, any new files created within the directory will inherit the "sales" group ownership from the directory itself. E. chmod 2775 sales This command explicitly sets the permissions for the "sales" directory. The octal code 2775 translates to: 2: owner has Read-Write-Execute (rwx) permissions 7: group has Read-Write-Execute (rwx) permissions 5: others have Read-Execute (rx) permissions The 7 in the second group of permissions ensures that new files created within the directory automatically inherit the "sales" group ownership.

edmiranda

http://www.dba-oracle.com/t_linux_setuid_setgid_skicky_bit.htm

NinymoOptions: AE

A. chmod g+s sales and E. chmod 2775 sales

slacked4222Options: AC

The correct answers are A. chmod g+s sales and C. chgrp -p sales sales. Option A: chmod g+s sales The chmod g+s command sets the group-set-ID bit for the directory sales. This means that new files created within the directory sales will inherit the group ownership of the directory, which is sales. Option C: chgrp -p sales sales The chgrp -p command changes the group ownership of the directory sales and all of its files and subdirectories recursively. This means that all files currently in the directory sales and all new files created within the directory will be owned by the group sales. Option E: chmod 2775 sales The chmod command changes the permissions of the directory sales. However, it does not affect the group ownership of the directory.

slacked4222

Says bard and gpt

MlolosOptions: AC

A and C according to chatGpt

Parazitenew

ChatGPT is wrong.

greendiceman

A and C are correct. E is chmod which is used to change file permissions not ownership.