1- Download and install Fing CLI
2- (Optional) Run without root
You'll also need superuser privileges to run fing
, you have have a few
options but be sure to understand what you're doing before you do it:
-
Create
/etc/sudoers.d/fing
to allow user to runfing
as root without a password.<<user>> ALL=(ALL) NOPASSWD: /usr/bin/fing
Use
$ which fing
to know the location of the executable. -
Set the SUID bit on the
fing
bin:sudo chmod u+s /usr/bin/fing
var scan = require('./index')
scan('192.168.0.1/24',function (hosts) {
console.log(hosts);
})
[ { Name: '',
Hostname: '',
HardwareAddress: '',
Address: '192.168.0.246',
Vendor: '',
State: 'up',
LastChangeTime: '' } ]