Rootmanual:SSH-forwarding

Från Lysators datorhandbok, den ultimata referensen.
Version från den 17 februari 2017 kl. 12.59 av Knase (diskussion | bidrag) (Add description about ssh-forwarding)
(skillnad) ← Äldre version | Nuvarande version (skillnad) | Nyare version → (skillnad)
Hoppa till navigering Hoppa till sök

Access a website over ssh

Access a site through another host

Access the site http(port 80) lysator.se through harbinger.lysator.liu.se

ssh -L 8080:lysator.se:80 <username>@harbinger.lysator.liu.se

Then to access the site you need to write localhost:8080 in your browser.

Access an internal website on a management network remotely

First forward so you are on the same network

ssh -L 8080:lysator.se:80 <username>@harbinger.lysator.liu.se

Then forward to the management network or keep nesting previous command if there are more hops. ssh -nNT -L 8080:lysator.se:80 <username>@<management hostname>

Then to access the site you need to write localhost:8080 in your browser.