Rootmanual:SSH-forwarding

Från Lysators datorhandbok, den ultimata referensen.
Version från den 23 mars 2017 kl. 14.59 av Knase (diskussion | bidrag) (Knase flyttade sidan SSH-forwarding till Rootmanual:SSH-forwarding: Should be in root manual)
(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.