1

I've successfully set up dynamic port forwarding over SSH in Pale Moon and added the alias as ssh-forward in .bashrc.

Now I have to execute both ssh-forward and palemoon to access the Internet over this tunnel.

I actually want to combine those commands resulting in only having to execute palemoon, and editing the .desktop file for it so it executes both commands when clicking on it.

This would also involve running the ssh-forward in the background, thus creating a PID for it.

What would be the best way to set this up? I'm specifically looking for a fast end-solution in which I would only have to click the icon, or executing palemoon from the Terminal.

1 Answer 1

0

openSSH supports LocalCommand, which can be used for this, just other way round than you describe. You run ssh-forward and as soon as it will be connected, the browser will start. It can work like this:

ssh -NTf -D localhost:9999 -oPermitLocalCommand=yes -oLocalCommand=palemoon host

of course addjust the ports and host.

This can be also put into the ~/.ssh/config to shorten the command itself:

Host proxy-host
  Hostname host
  User username
  PermitLocalCommand=yes
  LocalCommand=palemoon
  DynamicForward localhost:9999
  RequestTTY no

and then run just

ssh -Nf proxy-host

which will bring up the proxy and the browser. You can simply store this command in your "shortcut".

3
  • The -NTf parameters you described aren't in my command yet. How do they influence the existing command, which has -C and -D already and what's those -NTf parameters?
    – Condor
    Apr 28, 2016 at 18:07
  • They don't have to be there, but they are common in forwarding commands. I believe you will find their meaning in manual page.
    – Jakuje
    Apr 28, 2016 at 18:08
  • 1
    Ignorant me completely forgot about the manpages for a second, I'll take a look at it :)
    – Condor
    Apr 28, 2016 at 18:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .