Skip to content

Instantly share code, notes, and snippets.

@shubhamwagh
Last active December 7, 2021 11:33
Show Gist options
  • Save shubhamwagh/5bdda4f8fc7cab6bb4d38b604d3d3a73 to your computer and use it in GitHub Desktop.
Save shubhamwagh/5bdda4f8fc7cab6bb4d38b604d3d3a73 to your computer and use it in GitHub Desktop.
SSH Display forward
  • Make sure you have xauth installed. (See: xauth info or xauth list)
  • On the server your /etc/ssh/sshd_config file should have these lines:
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
  • Make sure on client side you have X server installed.
  • On the client side your ~/.ssh/config file should have these lines if not create new config file and add:
Host *
  ForwardAgent yes
  ForwardX11 yes
  • Then to do X11 forwarding using SSH, you need to add -X to your ssh command, e.g.
ssh -v -X user@host

then verify that your DISPLAY is not empty by:

echo $DISPLAY

If it is, then having verbose parameter for ssh (-v), check for any warnings, e.g.

debug1: No xauth program.
Warning: untrusted X11 forwarding setup failed: xauth key data not generated
@shubhamwagh
Copy link
Author

Some applications might require read or write permissions. Use the following command to do that.

sudo chown -R USER  ~/Documents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment