nerdexam
GIAC

GSEC · Question #242

You work as a Network Administrator for Secure World Inc. The company has a Linux-based network. You want to run a command with the changed root directory. Which of the following commands will you…

The correct answer is B. chroot <new root> <command>. The 'chroot' command runs a command or shell with a specified directory as the new root directory, isolating the process from the real filesystem root. This is commonly used for sandboxing and system recovery tasks.

Linux and Cryptography

Question

You work as a Network Administrator for Secure World Inc. The company has a Linux-based network. You want to run a command with the changed root directory. Which of the following commands will you use?

Options

  • Als <new root> <command>
  • Bchroot <new root> <command>
  • Croute <new root> <command>
  • Dchdir <new root> <command>

How the community answered

(23 responses)
  • A
    9% (2)
  • B
    78% (18)
  • C
    13% (3)

Why each option

The 'chroot' command runs a command or shell with a specified directory as the new root directory, isolating the process from the real filesystem root. This is commonly used for sandboxing and system recovery tasks.

Als <new root> <command>

'ls' is a directory listing command and has no ability to change the root directory or execute another command with a modified filesystem view.

Bchroot <new root> <command>Correct

The 'chroot <new root> <command>' syntax changes the apparent root directory to the specified path and then executes the given command within that confined environment. This is the standard Linux utility designed specifically for running processes with an alternative root directory, which is frequently used in security sandboxing, chroot jails, and system rescue scenarios.

Croute <new root> <command>

'route' is used to view and manipulate the IP routing table and has no functionality related to changing the root directory for command execution.

Dchdir <new root> <command>

'chdir' (or 'cd') changes the current working directory for the shell session, not the root directory, and it does not execute an arbitrary command in that context.

Concept tested: chroot command for changing root directory

Source: https://man7.org/linux/man-pages/man8/chroot.8.html

Topics

#chroot#root directory#Linux commands#privilege isolation

Community Discussion

No community discussion yet for this question.

Full GSEC Practice