nerdexam
CompTIA

XK0-004 · Question #196

An administrator receives the following message on a remote server: Cannot open display. Which of the following should the administrator have used to log in to the server? xrdp -h server.company.com A

The correct answer is B. ssh -X server.company.com. The 'Cannot open display' error indicates the remote session lacks X11 forwarding, which is enabled by passing the -X flag to SSH.

Troubleshooting and Diagnostics

Question

An administrator receives the following message on a remote server: Cannot open display. Which of the following should the administrator have used to log in to the server? xrdp -h server.company.com A.

Options

  • Bssh -X server.company.com
  • Cxvnc server.company.com

How the community answered

(28 responses)
  • B
    89% (25)
  • C
    11% (3)

Why each option

The 'Cannot open display' error indicates the remote session lacks X11 forwarding, which is enabled by passing the -X flag to SSH.

Bssh -X server.company.comCorrect

The `ssh -X` flag enables X11 forwarding, which tunnels the X display protocol over the SSH connection so GUI applications on the remote server render on the local client's display. Without this flag, the remote shell has no DISPLAY variable set, causing any graphical program to fail with 'Cannot open display'. This is the standard, built-in SSH mechanism for remote GUI access without a separate protocol.

Cxvnc server.company.com

`xvnc` starts a VNC server instance on the local or remote machine; it does not establish an outbound connection to a server or provide X11 forwarding over SSH.

Concept tested: SSH X11 forwarding for remote GUI access

Source: https://man.openbsd.org/ssh#X

Topics

#SSH#X11 forwarding#remote display#display error

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice