No xauth Program; Cannot Forward With Spoofing Error and Solution

in Categories , , , last updated March 15, 2017

I want to use my local machine as the X server over ssh. But when I try to run the command ssh -X -v user@server1.example.com> to the remote machine, I get the following error:
debug1: Remote: No xauth program; cannot forward with spoofing

How do I fix this problem and use X over ssh?

You need to have the xauth program installed on remote system. The xauth command is used to edit and display the authorization information used in connecting to the X server. You also need $HOME/.Xauthority default authority file.

Install xauth

Type the following command to install xauth under Fedora / RHEL / CentOS / Scientific / Red Hat Enterprise Linux:
# yum search xauth
# yum install xorg-x11-xauth

If you are using Debian / Ububtu Linux, enter:
$ sudo apt-get install xauth
The above command will install xauth and required libraries on the remote system. Now, you can connect using ssh as follows:
$ ssh -X user@s42.nixcraft.net.in
OR
$ ssh -X -C -c blowfish-cbc,arcfour user@s42.nixcraft.net.in

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

Share this on (or read 1 comments/add one below):

1 comment

  1. Yes, “yum install xorg-x11-xauth.x86_64” does resolve this issue on my CentOS 6.3(x86_64) machine.

    Have a question? Post it on our forum!