This port forwarding configuration describes how to tunnel X over SSH. It uses X Server (available on Play Store) to forward remote X applications from the SSH server. Please adjust addresses and ports to suit your needs.
Requirements
- A Pro license for JuiceSSH, enabling Port Forwarding functionality.
- An X Server on your Android device which is listening on port 6000.
- An SSH server named ssh.myxdomain.com which is listening on port 22.
Instructions
- Create your SSH Connection
- In the full connection list, hit New Connection.
- Enter the Type: SSH
- Enter the Address: ssh.myxdomain.com
- Enter the Port: 22
- Ensure the connection has a valid Identity containing a username and a password or private key.
- Add a Nickname and assign the connection to Groups if you wish.
- Hit Save, and test that your new connection connects successfully.
- Create your Port Forward Profile
- From the full connection list, swipe left and hit New Port Forward.
- Enter the following details:
- Enter the Name which you wish to identify port forwarding
- Connection: ssh.myxdomain.com (or nickname)
- Mode: Remote
- Port (from): 6001 (or any other X-ports between 6000-6009 available and not busy on remote ssh server)
- Destination: 127.0.0.1
- Port (to): 6000
- Open in browser after connecting: no
- Hit Save
- Activate the Port forward profile and check for the active profile's notification.
- Start X Server.
- Activate SSH Connection.
-
Start X application on SSH sever by means of command like this (for example):
env DISPLAY=:1 xclock
(Here DISPLAY=:1 corresponds to port number 6001, so DISPLAY=:2 corresponds to port number 6002 and so on.)
- Return to X Server window on your Android device and look at result.
-
When finished, use the notification, home screen widget/shortcut or full port forward list to disable the profile again.
For more in-depth study about X servers and X clients, refer to documentation on http://www.x.org site.