Tool to find ssh-able devices on your network.
Project description
Find SSH-able
Find SSH-able devices on your network and (optionally) add them to you ssh config in a cleanish way. Tested locally with MacOS and runs with Actions on Ubuntu.
Works by stringing together a couple nmap
commands and updating the ssh config file.
# find open port 22
nmap -sT -p 22 -T5 <network>
# check ssh auth methods
nmap -p 22 --script ssh-auth-methods <target>
Setup
-
Install nmap
# MacOS brew install nmap # Debian sudo apt-get install nmap
-
Install the script in
$HOME/bin
(hopefully on your path)./install.sh
-
Run the program
find-sshable --help
Python Package
pip install find-sshable
Testing
# pip install pytest
PYTHONPATH=. pytest -vs .
Headless Raspberry Pi
The idea is to stand up a headless raspberry pi that you can ssh into and do things on.
If you will run this on Wifi (not ethernet), start from here to configure the WiFi on your raspberry pi. However, if you can connect to ethernet, I would recommend doing so, and you can skip this step.
As per here add an empty ssh
file to the root
partition when you frist boot up.
Locally run the following. This will find and add your Pi to the local ssh config.
find-sshable --host-pattern "raspberrypi" --update-ssh-config --ssh-user "pi"
scanning for devices... 00:15
Found 2 devices...
Host(name='raspberrypi.lan', ip=IPv4Address('192.168.86.20'))
Host(name='raspberrypi.lan', ip=IPv4Address('192.168.86.36'))
Devices will be added to your ssh config as follows
find-sshable.raspberrypi.lan-0 192.168.86.20
find-sshable.raspberrypi.lan-1 192.168.86.36
ssh into it,
ssh find-sshable.raspberrypi.lan-0
On there, you should change your password, update locale, etc
sudo raspi-config
Also ensure that ssh runs on start up
sudo systemctl enable ssh
sudo systemctl start ssh
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file find-sshable-0.2.1.tar.gz
.
File metadata
- Download URL: find-sshable-0.2.1.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f02ba97eb0f4432d8ffc4856b905e68210cf9196b7fcfdde16a2b0082ecfd34b |
|
MD5 | 8b6f2383025b4cd534fce61116be23f8 |
|
BLAKE2b-256 | 90a36bf5c55852f4e7259a8391b29fa58dd84b49f88ec9cdf3e39fcb48d89727 |
File details
Details for the file find_sshable-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: find_sshable-0.2.1-py3-none-any.whl
- Upload date:
- Size: 19.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f89fee40f1d1428e66477967490e001a02b3139a31920f155a19760347c83ce |
|
MD5 | ed25f6677d3d72b2917e9cd8de00f784 |
|
BLAKE2b-256 | 7885db5023485923d4c73a71daa82411285f1a7421ee1dad94d47a56b3f0d03d |