router – How to Set Up SSH Server Without Port Forwarding Option in Router

portport-forwardingrouterssh

Sorry if this is something too basic, but I'm new in this kind of stuff… so I started a personal project a couple of days ago and for this little project I would like to connect to a notebook that I have (which is running CentOS 24/7) via SSH, actually I'm able to SSH to my notebook running CentOS with a device connected in my LAN, but I want to be able to do the same from anywhere, not just from my home, so according to what I've read I have to fordward port in my router, the problem is that I don't see this option…

My router is a DIR 615, Hardware Version: T1 and Firmware Version: 20.07

enter image description here

And these are all the options that I see:

Setup:

enter image description here

Wireless:

enter image description here

Advanced:

enter image description here

Maintenance:

enter image description here

Status:

enter image description here

Help:

enter image description here

What can I do? I've seen a lot of tutorials with the port fordward option, but they have other hardware version

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – EDIT – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

I tried the Virtual Server option, but it didn't work for me…

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – EDIT 2 – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

Okay, so elaborating in "I tried the Virtual Server option, but it didn't work for me", I did this:

  1. First I visited to http://www.whatsmyip.org/ to know my public IP, lets say that my public IP is X (according to me this is the IP where anything from the internet has to go to reach my LAN), and let's say that the private IP of my "server" is Y.
  2. So in the Virtual Server section:

enter image description here

I put the User-defined Service Name = SSH, Protocol = TCP, Wan and LAN Open port = 22 and Lan Ip Address = Y (the private Ip address of my notebook running CentOS 24/7, with this Ip Address I can successfully ssh if I'm using a device inside my LAN)

Now, what my logic says is that I should be able to ssh to my notebook with the command ssh user@X (remember, X is my public Ip), so I try to ssh to my notebook trough https://c9.io/ or first connecting to my university trough ssh and then trying to ssh to my notebook in my home, etc… I always get the same response which is: ssh: connect to host X port 22: Connection timed out after 30 seconds or something like that…

– – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – EDIT3 – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – – –

Is normal that in http://www.canyouseeme.org/ for every port I get this message?

enter image description here

I mean I tried 21, 22, 80, 53, 110, 143, etc… and like other 20 random ports and for each one I get the same response…

Best Answer

Well, at the end it was a problem of the modem-router that my ISP provided me (looking for a lot of time on the internet I found in a forum what is the password that my ISP puts in those models of modem-router and bingo, I could enter to the admin panel) Then I went to Port Filtering section and Port Forward section, let's say I want to connect from port 33734 when I'm outside my home, then in Port Filtering I enabled that port and in Port Fordward I Fordward that port to my router, then in my router in this section:

enter image description here

I put the User-defined Service Name = SSH, Protocol = TCP, Wan Port = 33734 and LAN Open port = 22 and Lan Ip Address = Local IP of my CentOS and then I could SSH to my CentOS trough https://c9.io/, that way I can SSH with default port when I'm home, but for outsiders they need to put another one (in th example I used 33734) Man, it feel so good :D

Related Question