LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-23-2009, 10:32 AM   #1
urentity
Member
 
Registered: Jan 2009
Posts: 48

Rep: Reputation: 15
how to ssh to a machine which changes ip?


OK, I've done a searcgh on this, and I get many results, but none really answering me this:

I started work at a corporate office. I have two RJ45 outlets for networking. I use one for the corporate computer and I stuck in an old linux computer on the second. It connects to the internet no problem.

Because it runs sshd, once I know the ip it's on, I can ssh into from anywhere, which is cool.

However, I switch it off and on everyday and I get a different ip address each time, so I never know which ip address I can communicate with it on.

Readin some howto's it says I can assign a static ip .. sure, but then it doesn't connect to the net at all.

Am I asking the impossible? I mean the machine needs to be given an ip address from the corporate dhcpd server and the policy is that it should be different each time or else sshing to it cannot happen. However though ssh is possible once that happens, the ip address is not fully known, so ssh doesn't happen.

The workaround is of course to take pencil and paper and make a note of the ip address it gets each time it turns on. IS that my best bet?
 
Old 02-23-2009, 10:38 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
do you recieve a public ip ?
then you can use dyndns
 
Old 02-23-2009, 10:43 AM   #3
urentity
Member
 
Registered: Jan 2009
Posts: 48

Original Poster
Rep: Reputation: 15
thanks repo,
yes it appears to be a public ip .. but it changes. You reckon dyndns could still handle that?
 
Old 02-23-2009, 10:53 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
You reckon dyndns could still handle that?
Yes, it is the purpose of this service.
just signup, and choose a name, then install the script.
Each time the ip changes, it will be associated by that name, so you just need to remember the name

http://www.dyndns.com/
goto free dynamic dns

another option is to write a script which will email the current ip to a mail address of your choise

Code:
ip addr show dev eth0 | grep inet\ | awk {'print $2'}|mail -s "IP work" me@me.com
 
  


Reply



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
cannot ssh virtual machine jonaskellens Linux - Networking 16 08-04-2008 03:13 AM
Cannot ssh to the ubuntu machine mesh2005 Linux - Networking 5 11-15-2006 07:11 AM
SSH forward from a Windows machine to a Linux machine isn't working nickj6282 Linux - Networking 3 08-13-2006 02:47 PM
ssh connection from a Windows machine to a Linux machine pistachio Linux - Networking 1 08-30-2005 10:45 AM
how to open a dilog on local machine when i do ssh to remote machine fahad26 Programming 3 05-03-2005 07:39 PM

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

All times are GMT -5. The time now is 04:01 AM.

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