Linux – X11 Forwarding


Install Xming

Setup Putty with the following:
Connection > SSH > X11
`-> [X] Enable X11 Forwarding
`-> (o) MIT-Magic_Cookie-1 (not sure if this does anything but it’s enabled for me)

Connection > SSH > Tunnels
`-> [X] Local ports accept connections from other hosts
`-> Remote ports do the same (SSH-2 only)

Once connected using your account, try to start up xclock from the shell. It should load in an Xming (be sure to have this installed) wrapper.

If you need to su to another user, you’ll need to bring your authorization to the other user

  1. Get your auth strings: xauth list
  2. su into the new user
  3. Try to run xclock again and it should give you an error with the display number it is expecting
    • ex: Error: Can’t open display: localhost:10.0
  4. From the list in step 1, enter
    • xauth add COPY-PASTE-STRNIG-HERE
    • ex: xauth add cablut1/unix:10 MIT-MAGIC-COOKIE-1 8158b00728563d71a9d8174a558859eb
  5. Try running xclock again and it should work this time


If you’re getting an error opening the display or wrong authorization, check if the display number is in there twice. Delete any incorrect entries.

Leave a Reply

Your email address will not be published. Required fields are marked *