@ Remote Server (a.blah.example.com)

  • Firewall (iptables)
    • Check if allow loopback

> iptables -A INPUT -i lo -j ACCEPT

  • Check if allow dport SSH

> iptables -A INPUT -p tcp -m tcp --dport ssh -j ACCEPT

  • /etc/ssh/sshd_config

X11Forwarding yes

X11DisplayOffset 10

X11UseLocalhost no

  • Restart ssh service
  • Run Xvfb process (Note: :88 needs to avoid conflict)

> Xvfb :88 -screen 0 1024x768x24

 

@ Client

  • macOS Sierra
    • Install XQuartz
    • logout and login
    • at /etc/ssh/ssh_config, XQuartz will add XAuthLocation

# XAuthLocation added by XQuartz (http://www.xquartz.org)
    Host *
        XAuthLocation /opt/X11/bin/xauth

  • Use terminal or iTerm to run xterm

> ssh -XY a.blah.example.com -l USER_NAME APPLICATION_NAME

e.g.:

> ssh -XY a.blah.example.com -l stephon xterm

  • Windows 7/10 (PuTTY + Xming / VcXsrv)
    • PuTTY Setting
      • Connection => SSH => X11
        • Enable X11 forwarding => checked 
        • X display location => blank
        • Remote X11 authentication protocol
          • MIT-Magic-Cookie-1
    • Run PuTTY, Then Xming / VcXsrv
    • After login to remote server, run xterm   

> xterm

  • Windows 10 (Bash on Windows + Xming / VcXsrv)   
    • Open bash   
    • Add export DISPLAY="localhost:0.0" in ~/.bashrc   
    • Reload .bashrc

> source .bashrc

  • Execute Xming / VcXsrv   
  • SSH login to remote server, and run xterm

> ssh -XY a.blah.example.com -l stephon xterm

    stephon 發表在 痞客邦 留言(1) 人氣()