LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-28-2024, 01:21 PM   #1
road hazard
Member
 
Registered: Nov 2015
Posts: 257

Rep: Reputation: Disabled
Question How to deal with non-static IP for incoming server on Asus router and a question about EASILY mapping a remote drive


I recently moved my backup server to my brother's house. Both are running Debian 12.

Right now, I have a static IP and his router is configured to only allow incoming SSH traffic from my IP address. (I think this is fairly secure?) And when my rsync job runs, it calls out to the Let's Encrypt DDNS name that his router registered with Asus. I have tested this and it's working PERFECTLY.

In the coming months, I'm probably going to be switching ISPs and will no longer have a static IP. If my IP changes, I won't be able to adjust his router to allow only my, unique IP as the source so I'm guessing I'll need to install Zerotier or Tailscale on my main server at my house and the backup server at his house so they can talk to each other for the backup job. I run Plex on my main server... will this cause any problems? Which one of those VPN services is DEAD SIMPLE to setup?

Or is there another way I should go about this if/when I switch ISPs and no longer have a static IP address? I used the ssh-copy-id to copy my keys to his server.... does that mean my unique keys were copied and it's safe to open the inbound ssh port forward to the world as only I would be able to authenticate to my remote server?

Yes, I'm a Linux newbie....especially when it comes to securing ssh.

I think I should also start reading up on fail2ban as well as an extra layer of security.
 
Old 04-29-2024, 07:23 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,751

Rep: Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929
The Asus router (depending on age) might have a VPN server built in. If so, I would pick OpenVPN if that is an option since installing a client is fairly easy and you can use nmcli to connect in your backup job. Using ssh keys only is safe.
 
Old 04-29-2024, 06:41 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
I do it the other way. I run rsync on the backup ‘puter and pull the data from the production box.
The backup server has a dynamic address, the production server has a static IP.

(I actually use rsnapshot, which uses rsync over ssh)
 
Old 04-30-2024, 02:18 PM   #4
road hazard
Member
 
Registered: Nov 2015
Posts: 257

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
The Asus router (depending on age) might have a VPN server built in. If so, I would pick OpenVPN if that is an option since installing a client is fairly easy and you can use nmcli to connect in your backup job. Using ssh keys only is safe.
His router is a newer model and has built in support for Open VPN but I think for now, I might just go with locking the source IP for the inbound rule to my IP address because I'm working on nailing down another problem and don't want to muddy the water. Will post about THAT issue here in a minute.
 
Old 04-30-2024, 02:19 PM   #5
road hazard
Member
 
Registered: Nov 2015
Posts: 257

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
I do it the other way. I run rsync on the backup ‘puter and pull the data from the production box.
The backup server has a dynamic address, the production server has a static IP.

(I actually use rsnapshot, which uses rsync over ssh)
But I think I'd have the same problem. If I had the remote server at his place pulling from me, I'd need to lock the inbound traffic to a single IP on my router (to be safe) and he definitely doesn't have a static IP.
 
Old 04-30-2024, 08:17 PM   #6
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by road hazard View Post
But I think I'd have the same problem. If I had the remote server at his place pulling from me, I'd need to lock the inbound traffic to a single IP on my router (to be safe) and he definitely doesn't have a static IP.
If you connect to your box from his box using SSH keys, you're "locking down" the connection between the computers themselves. The keys identify the hardware at the other end of the connection*...they don't care how the connection is made.

If the dynamic IP of my local "pulling" server changes, the connection and snapshot still works, and the keys provide the validation.

*"Hardware" in the sense that the key stored on the remote machine matches the key on the local machine.
 
Old 04-30-2024, 09:04 PM   #7
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,463
Blog Entries: 7

Rep: Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561Reputation: 2561
Quote:
Originally Posted by road hazard View Post
Or is there another way I should go about this if/when I switch ISPs and no longer have a static IP address?
Set up OpenVPN or WireGuard on the server (i.e: NOT at the router) at your brother's house. The remote client computer will be able to connect from any IP address without any trickery.

Tip: Use a high (UDP) port number.

Last edited by rkelsen; 04-30-2024 at 09:05 PM.
 
Old 04-30-2024, 09:36 PM   #8
road hazard
Member
 
Registered: Nov 2015
Posts: 257

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
If you connect to your box from his box using SSH keys, you're "locking down" the connection between the computers themselves. The keys identify the hardware at the other end of the connection*...they don't care how the connection is made.

If the dynamic IP of my local "pulling" server changes, the connection and snapshot still works, and the keys provide the validation.

*"Hardware" in the sense that the key stored on the remote machine matches the key on the local machine.
Thank you for the clarification.
 
Old 04-30-2024, 09:37 PM   #9
road hazard
Member
 
Registered: Nov 2015
Posts: 257

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rkelsen View Post
Set up OpenVPN or WireGuard on the server (i.e: NOT at the router) at your brother's house. The remote client computer will be able to connect from any IP address without any trickery.

Tip: Use a high (UDP) port number.
That sounds like a good idea indeed, thank you. I also might add fail2ban to the mix as well.
 
  


Reply

Tags
ssh access



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Java non-static variable cannot be referenced from a static context issue rickrvo Programming 2 02-12-2010 03:26 PM
LXer: The Fourth ‘Patent Deal’ was with Europe… and the Sixth Deal That Won’t be LXer Syndicated Linux News 0 10-24-2007 03:40 PM
Java: non-static variable this cannot be referenced from a static context chief_officer Programming 4 05-29-2006 01:37 PM
static member and non-static member allomeen Programming 9 01-06-2006 05:31 PM
how can i easily verify if my ISP is firewalling incoming connections? Hano Linux - Networking 4 09-23-2003 12:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration