|
|
Finding IP through terminal...
|
|
|
|
Forum Regular
Join Date: Jun 2003
Location: South of the border, UK
Status:
Offline
|
|
I've got the problem (I think) where my window server crashes freezes the machine. I've heard that you can SSH into the box, kill window server and all is well once more...
Being not a particularly unix-y person it took me a while to discover SSH, I've now signed in from my girlf's ibook into my imac great.
The only thing is that I need to know my IP (of my malfuctioning iMac) to SSH in, because when I tried SSH [computer name] log on, I got prompted for a password and then it didn't work. When I tried user@ipaddress, it worked fine.
My problem is this, as we are on a DCHP router, I won't know my IP until I need, i.e. too late. So what (if any) terminal command can I use on my girlf's ibook to to get the IP of my imac?
Once into the iMac I run 'top' (right?) get the PID, then do something like 'kill [PID]'... would that solve it??
Many thanks for any help and sorry for the lengthy introduction to a simple problem!!
|
"I'm Captain Chaos! Been in the force long...?"
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status:
Offline
|
|
ifconfig -a
Gives your the configuration of all your network interfaces (including IP addresses).
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Jun 2003
Location: South of the border, UK
Status:
Offline
|
|
Thanks for that, but unless I'm mistaken that gives the IP for the Local machine. I need the address of my imac on the network (which has frozen), then I can ssh in!
Cheers..
|
"I'm Captain Chaos! Been in the force long...?"
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Sep 2002
Location: New York, NY
Status:
Offline
|
|
You can use the Rendezvous name.
ssh [email protected]
Of course, this only works on an OS that supports Rendezvous, such as OS X.
|
Vandelay Industries
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Jun 2003
Location: South of the border, UK
Status:
Offline
|
|
Originally posted by Art Vandelay:
You can use the Rendezvous name.
ssh [email protected]l
Of course, this only works on an OS that supports Rendezvous, such as OS X.
Works like a charm, thanks!
|
"I'm Captain Chaos! Been in the force long...?"
|
|
|
|
|
|
|
|
Junior Member
Join Date: Nov 2003
Status:
Offline
|
|
in case you're ever in a situation where that isn't going to work, here's another option...
you can ping the broadcast address for your network to populate your arp cache, then dump your arp cache and look for the mac address you're seeking.
so for example, if you were in RFC1918 space on the network 192.168.1.0 and your netmask was 255.255.255.0 and you were looking for the IP of the device with macaddress 00:00:00:11:11:11, you could
ping 192.168.1.255
wait for replies
then arp -an | grep "00:00:00:11:11:11"
or don't grep it out and look through the dump yourself (should be small if you're not on a corporate lan or anything.
this won't always work, more specifically in corporate environments depending on certain configurations than a home config, but it's always worth a try.
also if you're on a dhcp router you have access to you should be able to look at its dhcp clients table. even easier :-)
just throwing it out there...
andrew davidoff
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Jan 2001
Status:
Offline
|
|
ifconfig | grep 'broadcast' | awk '{print $6}'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|