Using nmap to find a Raspberry Pi within a network

I find it really annoying to connect an HDMI monitor and a keyboard to the Pi, in order to get the IP address to connect with SSH. The terminal program nmap is able to scan your network and gets the IP easily.

If nmap isn’t installed, install it with your favorite paket manager. On debian based systems you can use the following command:

sudo apt-get install nmap

Get your own ip with the following command.

ifconfig

In my case my address is 192.168.1.106. This means that the Pi must be also within this range. The following command scans between 192.168.1.0 and 255.255.255.255, but the maximum has to be entered as CIDR and in binary. The binary value of each section (max number is 255) is 11111111, in sum 24 x 1 and that is exactly what needs to be entered.

nmap 192.168.1.0/24

The result of the command depends on the network. In my case it looks like the following:

Nmap scan report for 192.168.1.103
Host is up (0.045s latency).
Not shown: 999 closed ports
PORT STATE SERVICE
22/tcp open ssh

After you got the IP, you can use ssh to get access to the PI with the username pi and the password raspberry

ssh pi@192.168.1.103

I highly recommend to change the password after you successfully logged in for the first time.

Advertisements
This entry was posted in Linux, Technology and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s