LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Can i obtain the --- MAC ADDRESS --- of a remote host?? (https://www.linuxquestions.org/questions/linux-general-1/can-i-obtain-the-mac-address-of-a-remote-host-437176/)

eder_michael11 04-20-2006 01:18 PM

Can i obtain the --- MAC ADDRESS --- of a remote host??
 
is there some way to know the mac address of a host that is at my network ??


can i know my mac address?? i use SLACKWARE

i want to accept conections ... by ssh using the mac addres ... of the host... not ip ..

MensaWater 04-20-2006 01:29 PM

You can use the arp command for mac addresses.

However I'd say you have a bad idea there. If the other side's NIC goes bad and the MAC is NIC specific (which it usually is but not always) then they'd no longer be able to communicate with you when they replaced the failed NIC wih a working one. Not only that its not likely to help you anyway as ssh relies mainly on the key - the IP is just a way to know where it goes or comes from - in fact if you leave out the IP/hostname in your authorized_hosts it will still work because it only cares about the key.

eder_michael11 04-20-2006 02:55 PM

how use arp??
 
i used arp | less

but only displays 2 host that i dont care..

how can i know the mac adres for example of a host that names

servertest 10.41.0.146

bulliver 04-20-2006 04:45 PM

Code:

# nmap -v <host> | grep "MAC Address"
or if you have ssh access:
Code:

$ ssh <[user@]host> ifconfig | grep HWaddr | awk '{print $1": "$5}'

eder_michael11 04-24-2006 11:05 AM

sorry i dont have ssh acces .... and i maked

Quote:

# nmap -v <host> | grep "MAC Address"
and doesnt shows MAC ADDRESS

is there another way to know the MAC ADDRESS of a remote host...

and why when i make

ARP | LESS

only showsme 2 host tha are in my lan. and doesnt all the host in my lan?

Gad 08-18-2014 07:32 AM

arp - ip and corresponding MAC address
nmap - port scanner

jefro 08-18-2014 03:10 PM

We need to know where this box is first. For most use, you need to be on the same lan segment.

If on same lan then ping ip address. OK if it fails usually.

Then run arp -a command.

Not sure ssh by mac would be anymore secure.

We have to configure some devices once in a while. I don't like to play with the book way so I just make a static arp entry for the device so that it is within my subnet. Then I can access it via the ip address that I created in static arp. Be sure to remove or know about that static entry. It can be a bugger to fix if forgotten.


All times are GMT -5. The time now is 10:54 AM.