1

i need to run firefox process on a remote host via ssh and also keep process running even after ssh logout. I already have tried these ways nohup firefox & ,screen,disown -h . but it seems these work only for the process without hardware display.because these work fine with my scripts and I can keep my scripts running even after ssh log out but I can't do the same for firefox. I am stuck with this for long. please help me out here !

2 Answers2

3

With firefox , you are better off using a tunnel

ssh -D 8080 -CfN user@server

-D flag sets up dynamic port forwarding
-C uses compression
-f puts ssh into the background
-N Do not execute a remote command (useful for tunnels)

See man ssh for details

You then configure Firefox to use socks5 on localhost port 8080

Under preferences -> advanced -> network tab

8080

To close the tunnel, use

killall ssh

See also: https://calomel.org/firefox_ssh_proxy.html

Panther
  • 102,067
  • This is the response when i do ssh your way bind: Address already in use channel_setup_fwd_listener: cannot listen to port: 8080 Could not request local forwarding. – Pranay Agarwal Jan 28 '12 at 17:49
  • well I tried like dozens of other(>1024) ports.either there is just no response(just returns to terminal shell) or the address is already taken ! – Pranay Agarwal Jan 28 '12 at 18:00
  • i used killall ssh . But nothing has changed. when i give command to ssh.it asks for password and it just returns to terminal after i give the password :( .please help me out here.. Can we talk over chat ? – Pranay Agarwal Jan 28 '12 at 18:11
  • You are not understanding the instructions I gave you. The options -Nf put ssh into the background. You can then close the terminal if you wish. If you want to see the ssh connection or use commands, use ssh without the -Nf ssh -D 8080 -C user@server , but if you do that you can not close the terminal. – Panther Jan 28 '12 at 19:06
1

To run a remote X application through ssh, and free up the console where you run the command:

ssh -fX user@host Xapp

where Xapp is the remote X application. In case of Firefox you need the option -no-remote

ssh -fX user@host firefox -no-remote

Some information about the -f option:

 -f      Requests ssh to go to background just before command execution.
         This is useful if ssh is going to ask for passwords or
         passphrases, but the user wants it in the background.  This
         implies -n.  The recommended way to start X11 programs at a
         remote site is with something like ssh -f host xterm.
enzotib
  • 93,831