When you use the X11 forwarding option of SSH to connect to the remote connection, you may encounter an error when logging in, X11 forwarding request failed on channel 0” (X11 forwarding request failed on channel 0) What is the cause of the error? How to solve it? The following small series teaches you how to deal with this problem under Linux.
First, let's assume that you have properly enabled X11 forwarding for SSH.
If you encounter when you log on & ldquo; X11 forwarding request failed on channel 0 & rdquo; (X11 forwarding request failed on channel 0), there may be different reasons, and the solution is different.
Option One
For security reasons, OpenSSH service by default X11 forwarding the request to bind to the local loopback address, and is set to & ldquo in the DISPLAY environment variable in the host name; Localhost”. With this setting, some X11 clients cannot handle X11 forwarding correctly, which can lead to errors in the report. To solve this problem, add the following lines to the /etc/ssh/sshd configuration file, which binds the X11 forward request to the external network card address.
$ sudo vi /etc/ssh/sshd_config
X11Forwarding yesX11UseLocalhost no
Restart SSH for the settings to take effect:
$ sudo /etc/init.d /ssh restart (Debian 6, Ubuntu or Linux Mint)$ sudo systemctl restart ssh.service (Debian 7, CentOS/RHEL 7, Fedora)$ sudo service sshd restart (CentOS/RHEL 6)
Scenario 2 Br>
If the remote host's SSH service disables IPv6, an X11 forwarding failure error may also occur. To solve the error in this case. Open the /etc/ssh/sshd configuration file and uncomment the “AddressFamily all" (if there is one). Then join the following line. This forces the SSH service to use only IPv4 instead of IPv6. (LCTT Annotation: There may be errors here, AddressFamily does not have this parameter, and any means support both IPv6 and IPv4. In this scenario, it should be to disable IPv6 support, only IPv4, so it should be " Comment out AddressFamily any” is right.)
$ sudo vi /etc/ssh/sshd_config
AddressFamily inet
The above is the repair under Linux<X11 forwarding request failed on Channel 0” The wrong method is introduced. There are many reasons for this error. Different situations are handled differently. The current mention is that you have enabled X11 forwarding of SSH correctly.
After Kali Linux is installed, many people dont know how to configure the network.
Many netizens reported that there was a blue screen when installing VMWare on Linux. There was an er
Sometimes you want to sniff HTTP traffic for some kind of need, so how do you sniff
When doing Linux system operations, sometimes you need to back up the web files on
Linux Logo Command Line Tool Installation and Use
What should I do if VMware does not support full virtualization when installing 64-bit CentOS?
Linux SecureCRT Chinese garbled how to do?
How to solve the garbled problem after SecureCRT connects to Linux server
How to configure Kickstart script
How to use the read command under Linux
Solve the problem of installing Linux prompt Boot Efi does not have space to set up
Solution for adb connection failure under Mac or Linux
How to install and set up MQ in Linux
How to install the whois command on the CentOS system
How to view information about Linux loading built-in modules
Microsoft re-issued two patches for Win10 Build 9926
How to improve the transmission speed of USB devices
How to make the Win10 system automatically cross the fire line full screen
Win10 open service command, open service manager method summary
Play Win8.1 touch screen! Have to know the gestures to operate a large inventory
Win10 system how to close the bottom right corner advertising
Win7 system sets wifi hotspot for mobile devices
Win7 moves the taskbar to the right side of the screen and automatically hides the method