Jump to content

How Do I Access The Same Port On 2 Computers?


eovnu87435ds
 Share

Recommended Posts

Hey! I have a bit of a dilemma. I have 2 computers at home that I regularly ssh into from outside the network when i'm out and about. I can currently access computer 1 because my router is updating a DDNS address, and i have port 22 forwarded to that computer. However, when I want to access computer 2, I open my web browser and go to my ddns address:8080 to open the management for my router, change the ip address that 22 is fowarded to, and then ssh into computer 2 with the same command as computer 1.

Is there any way that I can ssh into either of those machines without having to access my router settings? I know that if anybody knows how, it'll be the folks here!

Link to comment
Share on other sites

Two solutions, and I recommend the first...

1) change the outside port you connect to. Using default ports typically isn't a good idea. So you can use external port 1337 to internal port 22 on computer1 IP;

And use external port 1338 to internal 22 on comp2's IP address.

2) SSH into computer 1, then SSH into computer 2 through computer 1...

Link to comment
Share on other sites

Two solutions, and I recommend the first...

1) change the outside port you connect to. Using default ports typically isn't a good idea. So you can use external port 1337 to internal port 22 on computer1 IP;

And use external port 1338 to internal 22 on comp2's IP address.

2) SSH into computer 1, then SSH into computer 2 through computer 1...

I do have a question regarding 1)

I also setup a nonstandard port to internal 22, however, It wouldn't work untill I set them both to 22 and I am assuming if i changed the ssh settings any two matching ports.

(This isn't the first time I have had this problem either )

What is causing this issue? with outside port differing from inside.

Link to comment
Share on other sites

When you SSH you have to specify the external port.

Say in Putty, you have to manually change it from port 22 to whatever the port is, the router will listen for port 1337 (example) and forward the traffic to port 22 internally to the destination IP. You cannot still connect on port 22 via outside the net because that port isn't forwarded.

Link to comment
Share on other sites

Is there any way that I can ssh into either of those machines without having to access my router settings? I know that if anybody knows how, it'll be the folks here!

hmmmm.... if you cant modify the router settings and a NAT is already set up to one computer that use combatwombat27's number 2 solution. if the other computer has a NAT setup to it but not on 22, you could change the ssh service to listen on the other port. All that said the best way is to set up the NAT's manually that way you dont have headache's dealing with using standard ports with non standard services. if you dont like the ports listed below, maybe choose 10022 and 20022. but again this will require you to modify your router settings.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...