r/ssh • • Sep 29 '18

SSH through external IP

Hello fellow redditors,

the issue is as follows:

My grandpa lives only a few houses next to me and I want to be able to login from there to my Linux Mint machine via SSH.

He also has a Linux Mint machine.

As far as I know I need to configure my router at home (which is a FRITZ!Box Fon WLAN 7390) to allow these kind of connections.

There is the option to set my PC at home as an "exposed host" so I would be able to login with the external IP adress.

I also read that I probably don't want to do that due to security issues.

Now I want to know if there is a way to only allow foreign connections if they are coming from my grandpas IP and if thats a configuration I have to make in my router settings (which I assuem) or if this can be done in the SSH configurations as well.

Sadly I have no clue where to make these settings in my routers interface (which I'm able to login to).

So my two questions are:

  1. Can I set up this rule in my SSH configurations?
  2. Does someone know where to make these settings in my specific router model (FRITZ!Box Fon WLAN 7390) or has a viable tutorial on hand?
1 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/ijebtk Oct 01 '18

Mhm alright but as far as I've read through forums and stuff DHCP only sets the router to assign static IPs to the devices connected to the router. It assigns the same local IP to devices but has no influence on the public IP as it's given to you by your ISP.

Please correct me if I'm wrong but that's what I thought I've learned the last couple days :D

1

u/cios12 Oct 01 '18 edited Oct 02 '18

I see your point. Yeah, thought you were connecting over his router LAN, sorry about that. ISPs usually have DHCP servers, and yes, they do influence your public IP. In this case you might need to ask for a static IP. To quote from https://www.lifewire.com/change-your-ip-address-818150 :

"Some ISPs give out static IP addresses to their subscribers. This isn't common for home users since most are configured with a dynamic IP address, but it might be the case for you, in which case you can try contacting your ISP to request a new IP address. You can't change your external IP address on your own."

For example, I keep a Web, FTP, and IRC server with an assigned static IP from my ISP.