nerdexam
CompTIA

XK0-005 · Question #788

A Linux administrator wants to change the default SSH server port. Which of the following files should the administrator edit to accomplish this task?

The correct answer is A. /etc/ssh/sshd_config. To change the default listening port for the SSH server, the administrator must modify the Port directive within the SSH daemon's configuration file.

System Management

Question

A Linux administrator wants to change the default SSH server port. Which of the following files should the administrator edit to accomplish this task?

Options

  • A/etc/ssh/sshd_config
  • B~/.ssh/config
  • C/etc/ssh/ssh_config
  • D/etc/ssh/ssh_host_rsa_key

How the community answered

(51 responses)
  • A
    88% (45)
  • B
    2% (1)
  • C
    6% (3)
  • D
    4% (2)

Why each option

To change the default listening port for the SSH server, the administrator must modify the `Port` directive within the SSH daemon's configuration file.

A/etc/ssh/sshd_configCorrect

The `/etc/ssh/sshd_config` file is the primary configuration file for the SSH daemon (`sshd`), which is the server-side component. To change the port on which the SSH server listens for incoming connections, the `Port` directive within this file must be edited.

B~/.ssh/config

The `~/.ssh/config` file is a user-specific client-side configuration file for the `ssh` command, used to configure client connections to remote servers.

C/etc/ssh/ssh_config

The `/etc/ssh/ssh_config` file is the system-wide client-side configuration file for the `ssh` command, which affects how local users connect to remote SSH servers.

D/etc/ssh/ssh_host_rsa_key

The `/etc/ssh/ssh_host_rsa_key` file contains the private RSA host key used by the SSH server for cryptographic identification, not a configuration setting for its listening port.

Concept tested: SSH server configuration (port)

Source: https://man7.org/linux/man-pages/man5/sshd_config.5.html

Topics

#SSH configuration#Network services#System files#Linux administration

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice