Grapping local ip using mac
I gather all my local ip using arp-scan , Then filter particular system ip by mac address, And connect automatically to that particular system using ssh. I tried the following commands through piping
Quote:
Its return the following error Quote:
|
I'm assuming that the following yields one IP address
Code:
sudo arp-scan --localnet|grep 10|cut -c1-12 Code:
sudo arp-scan --localnet|grep 10|cut -c1-12|xargs -L 1 -I host ssh user@host Code:
man xargs http://unix.stackexchange.com/questi...-multi-command |
BTW, I noticed that you mentioned
Quote:
Code:
sudo arp-scan --localnet|grep 10... |
Quote:
Thanks for info, But even i tried with this , I got the same error |
Quote:
Code:
sudo arp-scan --localnet|grep 10|cut -c1-12|xargs -L 1 -I host ssh |
It is used as a variablle
|
Quote:
Its just a show a welcome message instead opening a shell Quote:
|
be sure to have your hostname you want to use with its respective ip in your hosts file, as well. It looks to that to resolve addresses and hostnames. (i think first, then goes to the DSN server, if I remember correctly)
|
@BW-userx: the order is set in /etc/nsswitch.conf ; as you say, normally 'files' first (for some value of 'normal ;) )
My laptop has: Code:
#hosts: db files nisplus nis dns |
All times are GMT -5. The time now is 10:36 PM. |