Help Center/ Elastic Cloud Server/ Troubleshooting/ Remote Login/ Remote Login Errors on Linux/ What Do I Do If Xshell Fails to Connect to an ECS and "WARNING! The remote SSH server rejected X11 forwarding request." Is Displayed?
Updated on 2026-07-07 GMT+08:00

What Do I Do If Xshell Fails to Connect to an ECS and "WARNING! The remote SSH server rejected X11 forwarding request." Is Displayed?

Symptom

Xshell fails to connect to an ECS, and the error message "WARNING!The remote SSH server rejected X11 forwarding request." is displayed. The following figure shows the error details.

Possible Causes

The OpenSSH version is upgraded.

Solution

  1. Log in to the ECS.
  2. Edit the /etc/ssh/sshd_config file.

    vi /etc/ssh/sshd_config

  3. Modify the following configuration items:
    • Change the value of X11Forwarding to yes.
    • Delete the comment tag (#) from the UseLogin parameter and change the value to no.

    The following figure shows the modification result.

  4. Run the following command to restart the SSH service:

    systemctl restart sshd

  5. Run the following command to install the xorg-x11-xauth software package:

    yum install xorg-x11-xauth

  6. Restart the ECS.

    reboot