Which of the following commands makes /bin/foo executable by everyone but writable only by its owner?
Which of the following commands makes /bin/foo executable by everyone but writable only by its owner?
The command 'chmod u=rwx,go=rx /bin/foo' sets the permissions such that the owner (user) has read, write, and execute permissions, while the group and others have read and execute permissions. This configuration ensures that the file is executable by everyone but writable only by its owner.
The chmod command is used to change the permissions of a file or directory. The permissions of a file or directory are divided into three parts: owner, group, and others. Each part has three types of permissions: read, write, and execute. The first part of the chmod command specifies the permissions for the owner of the file (u for user). rwx means that the owner has read, write, and execute permissions. The second part specifies the permissions for the group of the file (g for group). rx means that the group has only read and execute permissions. The third part specifies the permissions for others (o for others). go= means that the group and others have no permissions. So, chmod u=rwx,go=rx /bin/foo sets the file permissions to read, write, and execute for the owner, read and execute for the group, and read and execute for others, making /bin/foo executable by everyone but writable only by its owner.
Sorry, I meant option A
Which of the following commands makes /bin/foo executable by everyone but writable only by its owner? This is a trick question, if you interpret is as the owner having just write permission, then none of the option is right, but if you interpret it as only the owner having write permission, then only option A meets that requirement.
A is correct. user (u) is set to read (r), write (w), execute (x) group (g) & others (o) are set to read (r) and execute (x)
Given answer is wrong. B is correct
In fact even B is wrong as it doesn't mention the group
A is the correct answer.