--- title: Chromium over ssh -X: Connection rejected because of wrong authentification date: 2022-09-02 summary: Forwarded X11 worked for xterm but the snap-packaged Chromium failed with "Connection rejected because of wrong authentification". The snap looks for .Xauthority inside its own home; symlinking it there fixes it. tags: x11, chromium, snap, ssh, ubuntu, xauthority environment: Ubuntu 20.04 (both ends); Chromium snap; OpenSSH X11 forwarding author: shaun status: published aliases: Chromium-X11-Connection-rejected-because-of-wrong-authentification.html --- ## Symptoms Between two Ubuntu 20.04 machines, `ssh -X` forwarding worked for `xterm` and friends, but Chromium refused to open: ```text Connection rejected because of wrong authentification ``` ## Cause Chromium on Ubuntu is a **snap**. Snaps get their own `$HOME` under `~/snap//current`, so Chromium looks for `.Xauthority` there and never finds the cookie that sshd wrote to `~/.Xauthority`. ## Fix Link the real file into the snap's home: ```bash ln -s ~/.Xauthority ~/snap/chromium/current/.Xauthority ``` Alternatively run it with `XAUTHORITY=$HOME/.Xauthority chromium`.