Skip to content

A dumb command-line tool for searching your Raspberry Pi in a local network

License

Notifications You must be signed in to change notification settings

pomponchik/searchpi

Repository files navigation

searchpi

Downloads Downloads Hits-of-Code Python versions PyPI version Ruff

This is a very stupid CLI tool that is designed to search for SSH-ready devices on your local network, starting with those with the most senior local IP addresses.

Before using this tool, install nmap on your computer. Then install the tool by pip:

pip install searchpi

And use:

searchpi 192.168.1.0/24 pomponchik ~/.ssh/id_rsa.pub --one

Here 192.168.1.0/24 means the range of addresses we are looking at, pomponchik is the username and ~/.ssh/id_rsa.pub is the name of the SSH key file. The --one option means that only the first address will be outputed to a console.

The command will print to the standard output the command that you will need to execute to connect to the remote machine via SSH:

>>> searchpi 192.168.1.0/24 pomponchik ~/.ssh/id_rsa.pub
ssh pomponchik@192.168.1.16

You can save your energy if you try to call the received command in the same line of code:

eval "$(searchpi 192.168.1.0/24 pomponchik ~/.ssh/id_rsa.pub --one)"

About

A dumb command-line tool for searching your Raspberry Pi in a local network

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages