Skip to main content

Find SSH-able

Python application

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

  1. Install nmap

    # MacOS
    brew install nmap
    # Debian
    sudo apt-get install nmap
    
  2. Install the script (defaults to $HOME/bin but can be overridden with first arg)

    ./install.sh $HOME/bin
    
  3. 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:07

    Found 1 devices...
    Host(name='raspberrypi.lan', ip=IPv4Address('192.168.86.36'))

    Devices will be added to your ssh config as follows
    find-sshable.raspberrypi.lan    192.168.86.36

ssh into it,

ssh find-sshable.raspberrypi.lan

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

Release files for find-sshable 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for find-sshable 0.2.3
File Size Uploaded
find-sshable-0.2.3.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for find-sshable 0.2.3
File Interpreter ABI Platform
find_sshable-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 37.3 kB

Release files / find-sshable-0.2.3.tar.gz

Download URL find-sshable-0.2.3.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f646120fb82859ca378e725f6b79f8c1e1fe545d6bf678b6f3a6b3a1dde6c653
BLAKE2b-256 checksum
How to use checksums
1724b86c568a1a5ca233ac3ead7ca97c5b051fd65e04d0e54aaed32957181a03
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / find_sshable-0.2.3-py3-none-any.whl

Download URL find_sshable-0.2.3-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d049758f6d7ef6903b8e0052411ef4c622ebeb98d62e447cc39f5706fa0a163
BLAKE2b-256 checksum
How to use checksums
974d4db39ff3137a25195386702f342327aa21b113e7c3dea55ff05631c13c92
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page