"M" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hi,
>
> Sorry I'm a newbie to networking and linux and I'm trying to figure
> out a way to connect to my linux box in 2 ways:
> 1. SSH'ing from my XP machine which is on wireless within the network
> 2. Being able to access it externally from anywhere via ssh or browser
>
> I have a cable modem, a Linksys wireless router with a linux box and
> XP laptop behind it. Here is a simple diagram of my network situation.
>
> I am completely lost
most likely because i have no idea what i'm
> doing. But trust me, i'm managing to confuse myself as much as
> possible.
>
> I also signed up for a DDNS service and i wanted to know how i could
> get the hostname i signed up for to point to my linux box behind my
> router. Currently it just seems to point to the router itself. I
> assume once I solve the previous problem above I can figure out this
> one.
>
> If anyone can help me figure this out or point me to some
> documentation with in some sort of step by step process I would VERY
> MUCH appreciate it. I've been trying to read previous posts but
> nothing seems to make sense to a newbie like me.
>
> Thank you in advance for your time and patience,
> M
I have a cable modem and a wired router. I access my Linux box over the
Internet using ssh. You need to open port 22 on you router, and forward it
to your Internal IP (192.xx.xx.xx) of the linux box. You do that with your
router admin page. That's key to all of this, whether you use a DDNS
hostname, or just the IP address.
I don't have a static IP, although it changes very infrequently (every few
months). So I just ssh to the IP address.
You should also read-up on "hardening" your box, such as shutting down any
unneeded services that could be an security risk. I bought a book a linux
security, which taught me alot.
In case the IP changes, I have a cron job that, every hour, mails the
current IP to a yahoo mail account (which gets filtered to "Trash"). So if
the IP changes, I'll know it remotely. Use
www.whatismyip.com as shown
below. The perl script just greps for an IP mask.
wget -q -O -
www.whatismyip.com | /usr/local/bin/ip.pl | mail -s "Linux
Maint Message: IP Address"
(E-Mail Removed)
----- ip.pl
#!/usr/bin/perl -w
use strict;
my $ip_mask = "(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})";
while (<>) {
while ( $_ =~ /($ip_mask)/ig ) {
print " $1\n";
}
}