When I ssh into my server and do my things there. How can I for example open a browser on the remote machine, and display it on my local machine,
I run Ubuntu desktop on my local machine. On server side I use Ubuntu 16.04 server. Its a development server so I have a python script there that use:
webbrowser.open("https://" + url)
to open default browser with the URL I need.
In other words how can I when I'm logged into the server, open a link on my local machine.
In more general words, how can I use my Ubuntu remote server machine as if its my local machine?
Since:
- A serverside machine doesn't NEED a GUI.
- I don't want to install a server GUI and use REMOTE DESKTOP.
How can I access my own development server and open a simple program on my local machine?
The easy way to do this, is to use SSH's socks proxy. From the man page:
Browsers can also use socks proxy. How to configure it depends on which browser you happen to use, but I typically use one browser for work over socks, and another for non-proxied work.
First, start ssh with the following command:
This will run ssh, creating a socks proxy to the remote host, listening on port 1080. In your browser, enter a socks proxy on localhost, port 1080. In Firefox this is located under Preferences - Advanced - Network:
This will tunnel traffic from the browser to the remote machine, and traffic will appear to be sourced from the remote machine.
First, in your server sshd_config, enable X11 forwarding as follow
Then ssh in your server:
Then launch firefox