Software⏱️ 3 min read📅 2026-06-03

How to Fix: What does "Warning: untrusted X11 forwarding setup failed: xauth key data not generated" mean when ssh'ing with -X?

Warning: untrusted X11 forwarding setup failed: xauth key data not generated

Quick Answer: This warning can be ignored, as X11 forwarding seems to work fine despite the message.

When using SSH with X11 forwarding on Mac (OS X 10.6.7) to connect to Ubuntu (11.04), you encounter a warning message that can be frustrating. The error is typically caused by an issue with the xauth key data generation, which is necessary for secure X11 forwarding.

This warning does not affect the functionality of X11 forwarding, but it indicates a potential security risk. Ignoring this warning may lead to unauthorized access to your system's graphical interface.

⚠️ Common Causes

  • The primary reason for this error is that xauth key data generation is not enabled on either the client or server side. On Macs running OS X, xauth is disabled by default due to security concerns.
  • Another possible cause is an issue with the display settings or the X11 forwarding configuration.

🚀 How to Resolve This Issue

Enabling xauth Key Generation

  1. Step 1: On your Mac (OS X 10.6.7), open the Terminal and run the following command to enable xauth key generation: `ssh -o 'X11Forwarding yes' user@ubuntu-server-address'. This will allow xauth to generate a secure key for X11 forwarding.
  2. Step 2: Alternatively, you can use the `-o` option to specify the xauth configuration file path. For example: `ssh -o '/path/to/xauth.conf' user@ubuntu-server-address'. Create an empty file named `xauth.conf` with the following content: `Xauthority /tmp/.X11-unix/':0' 10000 10000`. This will configure xauth to use a temporary file for X11 forwarding.
  3. Step 3: Once you've enabled xauth key generation, re-run your SSH command with `-X` option to test X11 forwarding.

Configuring the Server Side

  1. Step 1: On the Ubuntu server-side, edit the `/etc/ssh/sshd_config` file and add the following line: `X11Forwarding yes'. This will enable X11 forwarding on the server side.
  2. Step 2: Restart the SSH service to apply the changes: `sudo service ssh restart'.

💡 Conclusion

To resolve this warning, you can either enable xauth key generation on your Mac or configure the server-side to allow X11 forwarding. Both methods will ensure secure X11 forwarding and prevent potential security risks.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions