user2018791
user2018791

Reputation: 1153

username@host in ssh tunnel

I am reading the SSH Tunnel - Local and Remote Port Forwarding Explained With Examples

With regarding to local forwarding, one can use

ssh -4 -L 9999:remote-host:8888 [email protected] -N

What I can not understand here is [email protected]. What example.com should be?

In my environment, I am running a server listening on port 8888 in host1, in host2 I run

 ssh -4 -L 9999:host1:8888 myname@host1

Accessing host2:9999, I will go to the login page. If I change myname@host1 to myname@host2, even myname@host3, I can also go to the login page.So I can not understand what should be specified after myname@

Upvotes: 2

Views: 4066

Answers (1)

hek2mgl
hek2mgl

Reputation: 157947

So I can not understand what should be specified after myname@

You need to specify a host

  • where you can log in using ssh
  • which can access port 8888 on host1

In your scenario it seems like host1, host2 and host3 fit this requirements. I would configure the firewall in a way that only one of these hosts can be accessed using ssh from your host. But it depends on what you are doing.

Upvotes: 1

Related Questions