Metadata-Version: 2.4
Name: ssh-keyup
Version: 1.1.1
Summary: Passwordless SSH setup and ssh-copy-id alternative for Raspberry Pi, NVIDIA Jetson or any Linux device
Home-page: https://github.com/Kurokesu/ssh-keyup
Author: UAB Kurokesu
License: GPL-3.0-or-later
Project-URL: Repository, https://github.com/Kurokesu/ssh-keyup
Project-URL: Issues, https://github.com/Kurokesu/ssh-keyup/issues
Project-URL: Changelog, https://github.com/Kurokesu/ssh-keyup/releases
Keywords: ssh,ssh-keys,ssh-config,ssh-copy-id,passwordless-ssh,openssh,ed25519,raspberry-pi,rpi,jetson,iot,automation,vscode,remote-ssh,windows,linux
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: System :: Systems Administration
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# ssh-keyup

![CI](https://github.com/Kurokesu/ssh-keyup/actions/workflows/ci.yml/badge.svg)
![PyPI](https://img.shields.io/pypi/v/ssh-keyup)
![Python](https://img.shields.io/badge/python-3.8%2B-brightgreen)
![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux-blue)

**Set up passwordless SSH on Raspberry Pi, NVIDIA Jetson or any Linux device in one command.**

Tired of juggling `ssh-keygen`, `ssh-copy-id` (missing on Windows) and `~/.ssh/config` edits every time you set up a new device?

**`ssh-keyup`** handles all three in a single interactive session.

![ssh-keyup demo](https://raw.githubusercontent.com/Kurokesu/ssh-keyup/main/demo.gif)

## Quickstart

Install globally with pip:

```bash
pip install ssh-keyup

ssh-keyup   # ready to use anywhere
```

> [!TIP]
> If `ssh-keyup` is missing or runs an old version after install, the new
> script sits in a folder outside PATH (pip warns about this). Add that folder
> to PATH or use [pipx](https://pipx.pypa.io/): `pipx install ssh-keyup`.

Or run directly without installing:

```bash
git clone https://github.com/Kurokesu/ssh-keyup.git
cd ssh-keyup
python ssh_keyup.py   # Windows
python3 ssh_keyup.py  # Linux
```

Follow the prompts, enter the remote password once and you're done.

SSH from terminal:

```bash
ssh mypi   # no password, ever again
```

Or open [VSCode Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh), your `~/.ssh/config` is already set up. Press `Ctrl+Shift+P`, select **Remote-SSH: Connect to Host**, pick your alias and get a full IDE on your remote device, no password:

![VSCode Remote SSH](https://raw.githubusercontent.com/Kurokesu/ssh-keyup/main/demo-vscode.gif)

Skip the prompts by passing arguments:

```bash
ssh-keyup pi@192.168.1.23 mypi   # user, host and alias in one go
```

Or configure a whole fleet:

```bash
for host in 192.168.1.10 192.168.1.11 192.168.1.12; do
  ssh-keyup pi@$host
done
```

Flags (`--host`, `--user`, `--alias`) work too, see `ssh-keyup --help`.

List or remove entries ssh-keyup manages:

```bash
ssh-keyup --list
ssh-keyup --remove mypi   # deletes its key pair too
```

## Why?

```bash
# without ssh-keyup (repeat for every new device)
ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_ed25519_rpi5
scp ~/.ssh/id_ed25519_rpi5.pub trinity@192.168.1.23:~/
ssh trinity@192.168.1.23 "mkdir -p ~/.ssh && chmod 700 ~/.ssh"
ssh trinity@192.168.1.23 "cat ~/id_ed25519_rpi5.pub >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys && rm ~/id_ed25519_rpi5.pub"
nano ~/.ssh/config # add Host entry manually
...

# with ssh-keyup
ssh-keyup
```

## Prerequisites

**Python 3.8+** and OpenSSH tools (`ssh`, `ssh-keygen`) must be in PATH.

- **Windows 10/11**: Install Python from [python.org](https://www.python.org/downloads/) or the Microsoft Store. OpenSSH Client is included via Settings > Optional Features or ships with [Git for Windows](https://gitforwindows.org).
- **Linux**: `sudo apt install python3 openssh-client` (usually pre-installed).

## Features

- Generates a per-host **Ed25519** key pair (`~/.ssh/id_ed25519_<alias>`)
- Deploys public key to remote host in a **single SSH session**, only one password prompt
- **Never touches your password**. `ssh-keyup` only pipes the public key and **SSH** handles password authentication directly through its own terminal
- Adds a named entry to `~/.ssh/config`, works instantly with `ssh <alias>` and VSCode Remote SSH
- Detects and recovers from **host key mismatches** (common after reflashing)
- Handles re-runs gracefully: reuses existing keys or offers regeneration, detects duplicate config entries
- Works with any device reachable over SSH: Raspberry Pi, NVIDIA Jetson, Orange Pi, VMs, servers
- **Zero Python dependencies**, standard library only. Uses system OpenSSH (`ssh`, `ssh-keygen`)
- Installs via `pip` or runs as a single script
