nerdexam
LPI

010-150 · Question #5

Which TWO commands can be used to make the file /tmp/foo.txt readable for all users?

The correct answer is B. chmod 444 /tmp/foo.txt D. chmod 644 /tmp/foo.txt. Two chmod commands grant read permission to all users: 444 assigns read-only to everyone, and 644 assigns read-write to the owner and read-only to group and others.

Legal, Professional, and Ethical Responsibilities

Question

Which TWO commands can be used to make the file /tmp/foo.txt readable for all users?

Options

  • Achmod 111 /tmp/foo.txt
  • Bchmod 444 /tmp/foo.txt
  • Cchmod 770 /tmp/foo.txt
  • Dchmod 644 /tmp/foo.txt
  • Echmod 640 /tmp/foo.txt

How the community answered

(38 responses)
  • A
    11% (4)
  • B
    82% (31)
  • C
    5% (2)
  • E
    3% (1)

Why each option

Two chmod commands grant read permission to all users: 444 assigns read-only to everyone, and 644 assigns read-write to the owner and read-only to group and others.

Achmod 111 /tmp/foo.txt

chmod 111 sets only the execute bit for all three categories, granting no read permission to any user.

Bchmod 444 /tmp/foo.txtCorrect

chmod 444 sets the read bit (4) for owner, group, and others, giving every user read access with no write or execute permissions, satisfying the requirement for all users.

Cchmod 770 /tmp/foo.txt

chmod 770 grants read, write, and execute to the owner and group but assigns zero permissions to others, so non-group users cannot read the file.

Dchmod 644 /tmp/foo.txtCorrect

chmod 644 sets read-write (6) for the owner and read (4) for both group and others, so every user on the system retains at least read access to the file.

Echmod 640 /tmp/foo.txt

chmod 640 grants read-write to the owner and read to the group, but assigns no permissions to others, leaving users outside the group unable to read the file.

Concept tested: Linux octal chmod notation and read permissions

Source: https://man7.org/linux/man-pages/man1/chmod.1.html

Topics

#chmod#file permissions#read permissions#Linux security

Community Discussion

No community discussion yet for this question.

Full 010-150 Practice