12

I'm sshing into my friend's machine and I'm wondering how I would launch a GNOME session over SSH. I need to open a web browser on his machine to view something which can only be done from his hostname. What's the easiest way to achieve this via SSH?

7

Switch to a second terminal, for example tty2: CtrlAlt-F2, login and start a new X session on an available display:

xinit -- :1

Now ssh to the other machine, enabling X forwarding (or trusted X forwarding with -Y):

ssh -X user@machine

Once logged in, start a new gnome-session:

gnome-session

You can also pass gnome-session as a command to ssh.

| improve this answer | |
7

If all you need to do is run a web session, appearing to come from your friend's computer, I'd suggest just running OpenSSH with the ssh -D8888 argument (8888 is just an example), and set up your local browser to point to localhost:8888 as a SOCKS5 proxy.

If you must run a browser over the link, there's no reason why you need to start up an entire GNOME session, just run ssh -X as described in the other questions, and then run the browser alone.

| improve this answer | |
2

In Ubuntu, I use these commands:

ssh -X user@host gnome-session

or

ssh -Y user@host gnome-session

| improve this answer | |
2

You can use ssh -X or ssh -Y to his machine to run apps on your friend's machine but using your Xorg. The web browser will still be making the connection from his hostname.

| improve this answer | |
1

To launch gnome from terminal use the command startx.

| improve this answer | |
  • 1
    Nope. .xinitrc has to be set up for that, – RichieHH Jan 5 at 22:07
0

I found the x11vnc to be pretty easy.

Allowed me to see the remote active gnome desktop.

(Appears as a desktop app. I ssh-tunnel forward it's port on my local machine. Then connect my local vnc client to my local ssh-forwarded port.)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.