ssh-keyup 1.3.0__tar.gz → 1.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ssh-keyup
3
- Version: 1.3.0
4
- Summary: Passwordless SSH setup and ssh-copy-id alternative for any Linux or RouterOS device, such as Raspberry Pi, NVIDIA Jetson or MikroTik routers
3
+ Version: 1.4.1
4
+ Summary: One-command passwordless SSH from Windows or Linux to Raspberry Pi, NVIDIA Jetson, MikroTik and any Linux or RouterOS device
5
5
  Home-page: https://github.com/Kurokesu/ssh-keyup
6
6
  Author: UAB Kurokesu
7
7
  License: GPL-3.0-or-later
8
8
  Project-URL: Repository, https://github.com/Kurokesu/ssh-keyup
9
9
  Project-URL: Issues, https://github.com/Kurokesu/ssh-keyup/issues
10
10
  Project-URL: Changelog, https://github.com/Kurokesu/ssh-keyup/releases
11
- Keywords: ssh,ssh-keys,ssh-config,ssh-copy-id,passwordless-ssh,openssh,ed25519,raspberry-pi,rpi,jetson,mikrotik,routeros,iot,automation,vscode,remote-ssh,windows,linux
11
+ Keywords: ssh,ssh-key,ssh-keys,ssh-config,ssh-copy-id,authorized-keys,passwordless-ssh,openssh,ed25519,rsa,raspberry-pi,raspberrypi,rpi,jetson,nvidia-jetson,orange-pi,dietpi,mikrotik,routeros,iot,automation,vscode,remote-ssh,windows,linux
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Environment :: Console
14
14
  Classifier: Intended Audience :: Developers
@@ -16,6 +16,14 @@ Classifier: Intended Audience :: System Administrators
16
16
  Classifier: Operating System :: Microsoft :: Windows
17
17
  Classifier: Operating System :: POSIX :: Linux
18
18
  Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
+ Classifier: Topic :: Security
19
27
  Classifier: Topic :: System :: Networking
20
28
  Classifier: Topic :: System :: Systems Administration
21
29
  Classifier: Topic :: Utilities
@@ -41,17 +49,20 @@ Tired of juggling `ssh-keygen`, `ssh-copy-id` (missing on Windows) and `~/.ssh/c
41
49
 
42
50
  ## Quickstart
43
51
 
44
- Install globally with pip:
52
+ Needs **Python 3.8+** and OpenSSH tools (`ssh`, `ssh-keygen`) in PATH:
53
+
54
+ - **Windows 10/11**: Python from [python.org](https://www.python.org/downloads/) or Microsoft Store. OpenSSH Client via Settings > Optional Features or [Git for Windows](https://gitforwindows.org).
55
+ - **Linux**: `sudo apt install python3 openssh-client` (usually pre-installed).
56
+
57
+ Install with [pipx](https://pipx.pypa.io/stable/how-to/install-pipx.html):
45
58
 
46
59
  ```bash
47
- pip install ssh-keyup
60
+ pipx install ssh-keyup
48
61
 
49
62
  ssh-keyup # ready to use anywhere
50
63
  ```
51
64
 
52
- > **Tip:** If `ssh-keyup` is missing or runs an old version after install, new script sits in a folder outside PATH (pip warns about this). Add that folder to PATH, or install with [pipx](https://pipx.pypa.io/) instead:
53
- >
54
- > `pipx install ssh-keyup`
65
+ *`pip install ssh-keyup` works too. Add any folder it warns about to PATH.*
55
66
 
56
67
  Or run directly without installing:
57
68
 
@@ -70,9 +81,9 @@ Follow prompts, enter remote password once and you're done. Alias now works in a
70
81
  ssh mypi # no password, ever again
71
82
  ```
72
83
 
73
- **VSCode:** [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) works out of the box. Press `Ctrl+Shift+P`, select **Remote-SSH: Connect to Host** and pick your alias for a full IDE on the device, no password:
84
+ **VS Code:** [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) works out of the box. Press `Ctrl+Shift+P`, select **Remote-SSH: Connect to Host** and pick your alias for a full IDE on the device, no password:
74
85
 
75
- ![VSCode connecting to the mypi alias over Remote SSH without a password.](https://raw.githubusercontent.com/Kurokesu/ssh-keyup/main/docs/demo-vscode.gif)
86
+ ![VS Code connecting to the mypi alias over Remote SSH without a password.](https://raw.githubusercontent.com/Kurokesu/ssh-keyup/main/docs/demo-vscode.gif)
76
87
 
77
88
  ## Usage
78
89
 
@@ -84,7 +95,7 @@ ssh-keyup pi@192.168.1.23:2222 mypi # non-default SSH port
84
95
  ssh-keyup admin@192.168.88.1 router # RouterOS, detected automatically
85
96
  ```
86
97
 
87
- Flags (`--host`, `--user`, `--alias`, `--port`, `--os`) work too, see `ssh-keyup --help`
98
+ Flags (`--host`, `--user`, `--alias`, `--port`, `--os`, `--key-type`) work too, see `ssh-keyup --help`
88
99
 
89
100
  ### Set up a fleet
90
101
 
@@ -103,41 +114,34 @@ ssh-keyup --list
103
114
  ssh-keyup --remove mypi # deletes its key pair too
104
115
  ```
105
116
 
106
- ## Prerequisites
107
-
108
- **Python 3.8+** and OpenSSH tools (`ssh`, `ssh-keygen`) in PATH.
109
-
110
- - **Windows 10/11**: Python from [python.org](https://www.python.org/downloads/) or Microsoft Store. OpenSSH Client via Settings > Optional Features or [Git for Windows](https://gitforwindows.org).
111
- - **Linux**: `sudo apt install python3 openssh-client` (usually pre-installed).
112
-
113
117
  ## How it works
114
118
 
115
- ```mermaid
116
- flowchart LR
117
- run["ssh-keyup"] --> check["check connection"]
118
- check --> gen["generate ed25519 key<br/>~/.ssh/id_ed25519_mypi"]
119
- gen --> deploy["deploy public key<br/>~/.ssh/authorized_keys<br/>or /user/ssh-keys on RouterOS"]
120
- deploy --> config["update ssh config<br/>~/.ssh/config"]
119
+ ```text
120
+ local remote
121
+ check connection -------- SSH port --------> sshd
122
+ generate key ~/.ssh/id_ed25519_mypi
123
+ deploy public key -------- public key ------> ~/.ssh/authorized_keys
124
+ update ssh config ~/.ssh/config
121
125
  ```
122
126
 
123
127
  ## Features
124
128
 
125
129
  - Works on **Windows OpenSSH**, where `ssh-copy-id` does not exist
126
130
  - **Never touches your password**. Only the public key is piped over SSH and OpenSSH prompts for the password itself
127
- - One **Ed25519** key per device (`~/.ssh/id_ed25519_<alias>`), not one key reused everywhere
131
+ - **Separate key per device** (`~/.ssh/id_ed25519_<alias>`), Ed25519 by default or RSA with `--key-type rsa`
128
132
  - Deploys in a **single SSH session**, one password prompt total
129
- - Adds a named entry to `~/.ssh/config`, works instantly with `ssh <alias>` and VSCode Remote SSH
133
+ - Adds a named entry to `~/.ssh/config`, works instantly with `ssh <alias>` and VS Code Remote SSH
130
134
  - Checks host is **reachable** first, so typos surface before keys exist
131
135
  - Detects **RouterOS** and imports the key its way
132
- - Recovers from **host key mismatches** after a reflash
136
+ - Recovers from **host key mismatches** and stale SSH config entries after a reflash
133
137
  - **Entry management**, list or retire devices without leaving stale keys behind
134
138
  - **Zero dependencies**, standard library plus system OpenSSH
135
139
 
136
140
  ## FAQ
137
141
 
138
- ### Why not do it by hand?
142
+ ### How do I set up passwordless SSH from Windows by hand?
139
143
 
140
- Usual commands for passwordless SSH from Windows:
144
+ Usual commands:
141
145
 
142
146
  ```powershell
143
147
  ssh-keygen -t ed25519
@@ -147,15 +151,15 @@ notepad $env:USERPROFILE\.ssh\config # then add a Host block by hand
147
151
 
148
152
  Works once. Same key lands on every device, `~/.ssh` keeps default permissions that sshd may reject and each new device means another config edit.
149
153
 
150
- ### Why not ssh-copy-id?
154
+ ### Is there ssh-copy-id for Windows?
151
155
 
152
- `ssh-copy-id` appends a key to `authorized_keys` and stops there. Windows OpenSSH does not ship it at all and RouterOS has no `authorized_keys` to append to.
156
+ Not built in. Windows OpenSSH does not ship it and RouterOS has no `authorized_keys` for it to append to. `ssh-keyup` covers both as an `ssh-copy-id` alternative:
153
157
 
154
158
  | | ssh-keyup | ssh-copy-id |
155
159
  |---|:---:|:---:|
156
160
  | Works on Windows OpenSSH | yes | no |
157
161
  | Works with RouterOS | yes | no |
158
- | Ed25519 key per device | yes | no |
162
+ | Separate key per device | yes | no |
159
163
  | Sets `authorized_keys` permissions | yes | yes |
160
164
  | Writes `~/.ssh/config` alias | yes | no |
161
165
  | Recovers from changed host key | yes | no |
@@ -183,7 +187,11 @@ No. It deletes local key pair and `~/.ssh/config` entry. Line in the device's `a
183
187
 
184
188
  ### What devices are supported?
185
189
 
186
- Any Linux device reachable over SSH: Raspberry Pi, NVIDIA Jetson, Orange Pi, VMs, servers. Any RouterOS 7.12 or newer device, MikroTik routers or CHR alike, is detected from SSH banner and gets its own key import, `--os routeros` forces it.
190
+ Any Linux device reachable over SSH: Raspberry Pi, NVIDIA Jetson, Orange Pi, VMs, servers. Any distribution works (Raspberry Pi OS, DietPi, Ubuntu and others). Any RouterOS 7.12 or newer device, MikroTik routers or CHR alike, is detected from SSH banner and gets its own key import, `--os routeros` forces it.
191
+
192
+ ### Can I use an RSA key instead of Ed25519?
193
+
194
+ Yes. `--key-type rsa` generates a 4096-bit RSA key for devices or policies that will not take Ed25519. Keys carry their type in the name, `id_ed25519_mypi` or `id_rsa_mypi`, so switching type for an alias leaves the old key alone and ssh-keyup offers to delete it once the new one is verified working.
187
195
 
188
196
  ### How do I add an SSH key to a MikroTik router from Windows?
189
197
 
@@ -199,4 +207,4 @@ Works, with two password prompts and the default key shared across devices again
199
207
 
200
208
  ### Why does RouterOS refuse my password over SSH after adding a key?
201
209
 
202
- That is the default: once a user has a key, RouterOS stops accepting that user's password over SSH. WinBox and WebFig are unaffected, and password SSH can be turned back on under `/ip/ssh`.
210
+ That is the default: once a user has a key, RouterOS stops accepting that user's password over SSH. WinBox and WebFig are unaffected. `/ip/ssh/set password-authentication=yes` turns password SSH back on (`always-allow-password-login=yes` on 7.20 and older).
@@ -15,17 +15,20 @@ Tired of juggling `ssh-keygen`, `ssh-copy-id` (missing on Windows) and `~/.ssh/c
15
15
 
16
16
  ## Quickstart
17
17
 
18
- Install globally with pip:
18
+ Needs **Python 3.8+** and OpenSSH tools (`ssh`, `ssh-keygen`) in PATH:
19
+
20
+ - **Windows 10/11**: Python from [python.org](https://www.python.org/downloads/) or Microsoft Store. OpenSSH Client via Settings > Optional Features or [Git for Windows](https://gitforwindows.org).
21
+ - **Linux**: `sudo apt install python3 openssh-client` (usually pre-installed).
22
+
23
+ Install with [pipx](https://pipx.pypa.io/stable/how-to/install-pipx.html):
19
24
 
20
25
  ```bash
21
- pip install ssh-keyup
26
+ pipx install ssh-keyup
22
27
 
23
28
  ssh-keyup # ready to use anywhere
24
29
  ```
25
30
 
26
- > **Tip:** If `ssh-keyup` is missing or runs an old version after install, new script sits in a folder outside PATH (pip warns about this). Add that folder to PATH, or install with [pipx](https://pipx.pypa.io/) instead:
27
- >
28
- > `pipx install ssh-keyup`
31
+ *`pip install ssh-keyup` works too. Add any folder it warns about to PATH.*
29
32
 
30
33
  Or run directly without installing:
31
34
 
@@ -44,9 +47,9 @@ Follow prompts, enter remote password once and you're done. Alias now works in a
44
47
  ssh mypi # no password, ever again
45
48
  ```
46
49
 
47
- **VSCode:** [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) works out of the box. Press `Ctrl+Shift+P`, select **Remote-SSH: Connect to Host** and pick your alias for a full IDE on the device, no password:
50
+ **VS Code:** [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) works out of the box. Press `Ctrl+Shift+P`, select **Remote-SSH: Connect to Host** and pick your alias for a full IDE on the device, no password:
48
51
 
49
- ![VSCode connecting to the mypi alias over Remote SSH without a password.](https://raw.githubusercontent.com/Kurokesu/ssh-keyup/main/docs/demo-vscode.gif)
52
+ ![VS Code connecting to the mypi alias over Remote SSH without a password.](https://raw.githubusercontent.com/Kurokesu/ssh-keyup/main/docs/demo-vscode.gif)
50
53
 
51
54
  ## Usage
52
55
 
@@ -58,7 +61,7 @@ ssh-keyup pi@192.168.1.23:2222 mypi # non-default SSH port
58
61
  ssh-keyup admin@192.168.88.1 router # RouterOS, detected automatically
59
62
  ```
60
63
 
61
- Flags (`--host`, `--user`, `--alias`, `--port`, `--os`) work too, see `ssh-keyup --help`
64
+ Flags (`--host`, `--user`, `--alias`, `--port`, `--os`, `--key-type`) work too, see `ssh-keyup --help`
62
65
 
63
66
  ### Set up a fleet
64
67
 
@@ -77,41 +80,34 @@ ssh-keyup --list
77
80
  ssh-keyup --remove mypi # deletes its key pair too
78
81
  ```
79
82
 
80
- ## Prerequisites
81
-
82
- **Python 3.8+** and OpenSSH tools (`ssh`, `ssh-keygen`) in PATH.
83
-
84
- - **Windows 10/11**: Python from [python.org](https://www.python.org/downloads/) or Microsoft Store. OpenSSH Client via Settings > Optional Features or [Git for Windows](https://gitforwindows.org).
85
- - **Linux**: `sudo apt install python3 openssh-client` (usually pre-installed).
86
-
87
83
  ## How it works
88
84
 
89
- ```mermaid
90
- flowchart LR
91
- run["ssh-keyup"] --> check["check connection"]
92
- check --> gen["generate ed25519 key<br/>~/.ssh/id_ed25519_mypi"]
93
- gen --> deploy["deploy public key<br/>~/.ssh/authorized_keys<br/>or /user/ssh-keys on RouterOS"]
94
- deploy --> config["update ssh config<br/>~/.ssh/config"]
85
+ ```text
86
+ local remote
87
+ check connection -------- SSH port --------> sshd
88
+ generate key ~/.ssh/id_ed25519_mypi
89
+ deploy public key -------- public key ------> ~/.ssh/authorized_keys
90
+ update ssh config ~/.ssh/config
95
91
  ```
96
92
 
97
93
  ## Features
98
94
 
99
95
  - Works on **Windows OpenSSH**, where `ssh-copy-id` does not exist
100
96
  - **Never touches your password**. Only the public key is piped over SSH and OpenSSH prompts for the password itself
101
- - One **Ed25519** key per device (`~/.ssh/id_ed25519_<alias>`), not one key reused everywhere
97
+ - **Separate key per device** (`~/.ssh/id_ed25519_<alias>`), Ed25519 by default or RSA with `--key-type rsa`
102
98
  - Deploys in a **single SSH session**, one password prompt total
103
- - Adds a named entry to `~/.ssh/config`, works instantly with `ssh <alias>` and VSCode Remote SSH
99
+ - Adds a named entry to `~/.ssh/config`, works instantly with `ssh <alias>` and VS Code Remote SSH
104
100
  - Checks host is **reachable** first, so typos surface before keys exist
105
101
  - Detects **RouterOS** and imports the key its way
106
- - Recovers from **host key mismatches** after a reflash
102
+ - Recovers from **host key mismatches** and stale SSH config entries after a reflash
107
103
  - **Entry management**, list or retire devices without leaving stale keys behind
108
104
  - **Zero dependencies**, standard library plus system OpenSSH
109
105
 
110
106
  ## FAQ
111
107
 
112
- ### Why not do it by hand?
108
+ ### How do I set up passwordless SSH from Windows by hand?
113
109
 
114
- Usual commands for passwordless SSH from Windows:
110
+ Usual commands:
115
111
 
116
112
  ```powershell
117
113
  ssh-keygen -t ed25519
@@ -121,15 +117,15 @@ notepad $env:USERPROFILE\.ssh\config # then add a Host block by hand
121
117
 
122
118
  Works once. Same key lands on every device, `~/.ssh` keeps default permissions that sshd may reject and each new device means another config edit.
123
119
 
124
- ### Why not ssh-copy-id?
120
+ ### Is there ssh-copy-id for Windows?
125
121
 
126
- `ssh-copy-id` appends a key to `authorized_keys` and stops there. Windows OpenSSH does not ship it at all and RouterOS has no `authorized_keys` to append to.
122
+ Not built in. Windows OpenSSH does not ship it and RouterOS has no `authorized_keys` for it to append to. `ssh-keyup` covers both as an `ssh-copy-id` alternative:
127
123
 
128
124
  | | ssh-keyup | ssh-copy-id |
129
125
  |---|:---:|:---:|
130
126
  | Works on Windows OpenSSH | yes | no |
131
127
  | Works with RouterOS | yes | no |
132
- | Ed25519 key per device | yes | no |
128
+ | Separate key per device | yes | no |
133
129
  | Sets `authorized_keys` permissions | yes | yes |
134
130
  | Writes `~/.ssh/config` alias | yes | no |
135
131
  | Recovers from changed host key | yes | no |
@@ -157,7 +153,11 @@ No. It deletes local key pair and `~/.ssh/config` entry. Line in the device's `a
157
153
 
158
154
  ### What devices are supported?
159
155
 
160
- Any Linux device reachable over SSH: Raspberry Pi, NVIDIA Jetson, Orange Pi, VMs, servers. Any RouterOS 7.12 or newer device, MikroTik routers or CHR alike, is detected from SSH banner and gets its own key import, `--os routeros` forces it.
156
+ Any Linux device reachable over SSH: Raspberry Pi, NVIDIA Jetson, Orange Pi, VMs, servers. Any distribution works (Raspberry Pi OS, DietPi, Ubuntu and others). Any RouterOS 7.12 or newer device, MikroTik routers or CHR alike, is detected from SSH banner and gets its own key import, `--os routeros` forces it.
157
+
158
+ ### Can I use an RSA key instead of Ed25519?
159
+
160
+ Yes. `--key-type rsa` generates a 4096-bit RSA key for devices or policies that will not take Ed25519. Keys carry their type in the name, `id_ed25519_mypi` or `id_rsa_mypi`, so switching type for an alias leaves the old key alone and ssh-keyup offers to delete it once the new one is verified working.
161
161
 
162
162
  ### How do I add an SSH key to a MikroTik router from Windows?
163
163
 
@@ -173,4 +173,4 @@ Works, with two password prompts and the default key shared across devices again
173
173
 
174
174
  ### Why does RouterOS refuse my password over SSH after adding a key?
175
175
 
176
- That is the default: once a user has a key, RouterOS stops accepting that user's password over SSH. WinBox and WebFig are unaffected, and password SSH can be turned back on under `/ip/ssh`.
176
+ That is the default: once a user has a key, RouterOS stops accepting that user's password over SSH. WinBox and WebFig are unaffected. `/ip/ssh/set password-authentication=yes` turns password SSH back on (`always-allow-password-login=yes` on 7.20 and older).
@@ -7,3 +7,8 @@ build-backend = "setuptools.build_meta"
7
7
  line-length = 79
8
8
  # match python_requires, keeps fixes runtime safe on old Pythons
9
9
  target-version = "py38"
10
+
11
+ [tool.pytest.ini_options]
12
+ # plain pytest runs unit tests only
13
+ addopts = "-m 'not integration'"
14
+ markers = ["integration: drives a live SSH target"]
@@ -1,7 +1,7 @@
1
1
  [metadata]
2
2
  name = ssh-keyup
3
3
  version = attr: ssh_keyup.__version__
4
- description = Passwordless SSH setup and ssh-copy-id alternative for any Linux or RouterOS device, such as Raspberry Pi, NVIDIA Jetson or MikroTik routers
4
+ description = One-command passwordless SSH from Windows or Linux to Raspberry Pi, NVIDIA Jetson, MikroTik and any Linux or RouterOS device
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
7
7
  author = UAB Kurokesu
@@ -12,7 +12,7 @@ project_urls =
12
12
  Repository = https://github.com/Kurokesu/ssh-keyup
13
13
  Issues = https://github.com/Kurokesu/ssh-keyup/issues
14
14
  Changelog = https://github.com/Kurokesu/ssh-keyup/releases
15
- keywords = ssh, ssh-keys, ssh-config, ssh-copy-id, passwordless-ssh, openssh, ed25519, raspberry-pi, rpi, jetson, mikrotik, routeros, iot, automation, vscode, remote-ssh, windows, linux
15
+ keywords = ssh, ssh-key, ssh-keys, ssh-config, ssh-copy-id, authorized-keys, passwordless-ssh, openssh, ed25519, rsa, raspberry-pi, raspberrypi, rpi, jetson, nvidia-jetson, orange-pi, dietpi, mikrotik, routeros, iot, automation, vscode, remote-ssh, windows, linux
16
16
  classifiers =
17
17
  Development Status :: 5 - Production/Stable
18
18
  Environment :: Console
@@ -21,6 +21,14 @@ classifiers =
21
21
  Operating System :: Microsoft :: Windows
22
22
  Operating System :: POSIX :: Linux
23
23
  Programming Language :: Python :: 3
24
+ Programming Language :: Python :: 3.8
25
+ Programming Language :: Python :: 3.9
26
+ Programming Language :: Python :: 3.10
27
+ Programming Language :: Python :: 3.11
28
+ Programming Language :: Python :: 3.12
29
+ Programming Language :: Python :: 3.13
30
+ Programming Language :: Python :: 3.14
31
+ Topic :: Security
24
32
  Topic :: System :: Networking
25
33
  Topic :: System :: Systems Administration
26
34
  Topic :: Utilities
@@ -1,14 +1,14 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ssh-keyup
3
- Version: 1.3.0
4
- Summary: Passwordless SSH setup and ssh-copy-id alternative for any Linux or RouterOS device, such as Raspberry Pi, NVIDIA Jetson or MikroTik routers
3
+ Version: 1.4.1
4
+ Summary: One-command passwordless SSH from Windows or Linux to Raspberry Pi, NVIDIA Jetson, MikroTik and any Linux or RouterOS device
5
5
  Home-page: https://github.com/Kurokesu/ssh-keyup
6
6
  Author: UAB Kurokesu
7
7
  License: GPL-3.0-or-later
8
8
  Project-URL: Repository, https://github.com/Kurokesu/ssh-keyup
9
9
  Project-URL: Issues, https://github.com/Kurokesu/ssh-keyup/issues
10
10
  Project-URL: Changelog, https://github.com/Kurokesu/ssh-keyup/releases
11
- Keywords: ssh,ssh-keys,ssh-config,ssh-copy-id,passwordless-ssh,openssh,ed25519,raspberry-pi,rpi,jetson,mikrotik,routeros,iot,automation,vscode,remote-ssh,windows,linux
11
+ Keywords: ssh,ssh-key,ssh-keys,ssh-config,ssh-copy-id,authorized-keys,passwordless-ssh,openssh,ed25519,rsa,raspberry-pi,raspberrypi,rpi,jetson,nvidia-jetson,orange-pi,dietpi,mikrotik,routeros,iot,automation,vscode,remote-ssh,windows,linux
12
12
  Classifier: Development Status :: 5 - Production/Stable
13
13
  Classifier: Environment :: Console
14
14
  Classifier: Intended Audience :: Developers
@@ -16,6 +16,14 @@ Classifier: Intended Audience :: System Administrators
16
16
  Classifier: Operating System :: Microsoft :: Windows
17
17
  Classifier: Operating System :: POSIX :: Linux
18
18
  Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.8
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Programming Language :: Python :: 3.14
26
+ Classifier: Topic :: Security
19
27
  Classifier: Topic :: System :: Networking
20
28
  Classifier: Topic :: System :: Systems Administration
21
29
  Classifier: Topic :: Utilities
@@ -41,17 +49,20 @@ Tired of juggling `ssh-keygen`, `ssh-copy-id` (missing on Windows) and `~/.ssh/c
41
49
 
42
50
  ## Quickstart
43
51
 
44
- Install globally with pip:
52
+ Needs **Python 3.8+** and OpenSSH tools (`ssh`, `ssh-keygen`) in PATH:
53
+
54
+ - **Windows 10/11**: Python from [python.org](https://www.python.org/downloads/) or Microsoft Store. OpenSSH Client via Settings > Optional Features or [Git for Windows](https://gitforwindows.org).
55
+ - **Linux**: `sudo apt install python3 openssh-client` (usually pre-installed).
56
+
57
+ Install with [pipx](https://pipx.pypa.io/stable/how-to/install-pipx.html):
45
58
 
46
59
  ```bash
47
- pip install ssh-keyup
60
+ pipx install ssh-keyup
48
61
 
49
62
  ssh-keyup # ready to use anywhere
50
63
  ```
51
64
 
52
- > **Tip:** If `ssh-keyup` is missing or runs an old version after install, new script sits in a folder outside PATH (pip warns about this). Add that folder to PATH, or install with [pipx](https://pipx.pypa.io/) instead:
53
- >
54
- > `pipx install ssh-keyup`
65
+ *`pip install ssh-keyup` works too. Add any folder it warns about to PATH.*
55
66
 
56
67
  Or run directly without installing:
57
68
 
@@ -70,9 +81,9 @@ Follow prompts, enter remote password once and you're done. Alias now works in a
70
81
  ssh mypi # no password, ever again
71
82
  ```
72
83
 
73
- **VSCode:** [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) works out of the box. Press `Ctrl+Shift+P`, select **Remote-SSH: Connect to Host** and pick your alias for a full IDE on the device, no password:
84
+ **VS Code:** [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) works out of the box. Press `Ctrl+Shift+P`, select **Remote-SSH: Connect to Host** and pick your alias for a full IDE on the device, no password:
74
85
 
75
- ![VSCode connecting to the mypi alias over Remote SSH without a password.](https://raw.githubusercontent.com/Kurokesu/ssh-keyup/main/docs/demo-vscode.gif)
86
+ ![VS Code connecting to the mypi alias over Remote SSH without a password.](https://raw.githubusercontent.com/Kurokesu/ssh-keyup/main/docs/demo-vscode.gif)
76
87
 
77
88
  ## Usage
78
89
 
@@ -84,7 +95,7 @@ ssh-keyup pi@192.168.1.23:2222 mypi # non-default SSH port
84
95
  ssh-keyup admin@192.168.88.1 router # RouterOS, detected automatically
85
96
  ```
86
97
 
87
- Flags (`--host`, `--user`, `--alias`, `--port`, `--os`) work too, see `ssh-keyup --help`
98
+ Flags (`--host`, `--user`, `--alias`, `--port`, `--os`, `--key-type`) work too, see `ssh-keyup --help`
88
99
 
89
100
  ### Set up a fleet
90
101
 
@@ -103,41 +114,34 @@ ssh-keyup --list
103
114
  ssh-keyup --remove mypi # deletes its key pair too
104
115
  ```
105
116
 
106
- ## Prerequisites
107
-
108
- **Python 3.8+** and OpenSSH tools (`ssh`, `ssh-keygen`) in PATH.
109
-
110
- - **Windows 10/11**: Python from [python.org](https://www.python.org/downloads/) or Microsoft Store. OpenSSH Client via Settings > Optional Features or [Git for Windows](https://gitforwindows.org).
111
- - **Linux**: `sudo apt install python3 openssh-client` (usually pre-installed).
112
-
113
117
  ## How it works
114
118
 
115
- ```mermaid
116
- flowchart LR
117
- run["ssh-keyup"] --> check["check connection"]
118
- check --> gen["generate ed25519 key<br/>~/.ssh/id_ed25519_mypi"]
119
- gen --> deploy["deploy public key<br/>~/.ssh/authorized_keys<br/>or /user/ssh-keys on RouterOS"]
120
- deploy --> config["update ssh config<br/>~/.ssh/config"]
119
+ ```text
120
+ local remote
121
+ check connection -------- SSH port --------> sshd
122
+ generate key ~/.ssh/id_ed25519_mypi
123
+ deploy public key -------- public key ------> ~/.ssh/authorized_keys
124
+ update ssh config ~/.ssh/config
121
125
  ```
122
126
 
123
127
  ## Features
124
128
 
125
129
  - Works on **Windows OpenSSH**, where `ssh-copy-id` does not exist
126
130
  - **Never touches your password**. Only the public key is piped over SSH and OpenSSH prompts for the password itself
127
- - One **Ed25519** key per device (`~/.ssh/id_ed25519_<alias>`), not one key reused everywhere
131
+ - **Separate key per device** (`~/.ssh/id_ed25519_<alias>`), Ed25519 by default or RSA with `--key-type rsa`
128
132
  - Deploys in a **single SSH session**, one password prompt total
129
- - Adds a named entry to `~/.ssh/config`, works instantly with `ssh <alias>` and VSCode Remote SSH
133
+ - Adds a named entry to `~/.ssh/config`, works instantly with `ssh <alias>` and VS Code Remote SSH
130
134
  - Checks host is **reachable** first, so typos surface before keys exist
131
135
  - Detects **RouterOS** and imports the key its way
132
- - Recovers from **host key mismatches** after a reflash
136
+ - Recovers from **host key mismatches** and stale SSH config entries after a reflash
133
137
  - **Entry management**, list or retire devices without leaving stale keys behind
134
138
  - **Zero dependencies**, standard library plus system OpenSSH
135
139
 
136
140
  ## FAQ
137
141
 
138
- ### Why not do it by hand?
142
+ ### How do I set up passwordless SSH from Windows by hand?
139
143
 
140
- Usual commands for passwordless SSH from Windows:
144
+ Usual commands:
141
145
 
142
146
  ```powershell
143
147
  ssh-keygen -t ed25519
@@ -147,15 +151,15 @@ notepad $env:USERPROFILE\.ssh\config # then add a Host block by hand
147
151
 
148
152
  Works once. Same key lands on every device, `~/.ssh` keeps default permissions that sshd may reject and each new device means another config edit.
149
153
 
150
- ### Why not ssh-copy-id?
154
+ ### Is there ssh-copy-id for Windows?
151
155
 
152
- `ssh-copy-id` appends a key to `authorized_keys` and stops there. Windows OpenSSH does not ship it at all and RouterOS has no `authorized_keys` to append to.
156
+ Not built in. Windows OpenSSH does not ship it and RouterOS has no `authorized_keys` for it to append to. `ssh-keyup` covers both as an `ssh-copy-id` alternative:
153
157
 
154
158
  | | ssh-keyup | ssh-copy-id |
155
159
  |---|:---:|:---:|
156
160
  | Works on Windows OpenSSH | yes | no |
157
161
  | Works with RouterOS | yes | no |
158
- | Ed25519 key per device | yes | no |
162
+ | Separate key per device | yes | no |
159
163
  | Sets `authorized_keys` permissions | yes | yes |
160
164
  | Writes `~/.ssh/config` alias | yes | no |
161
165
  | Recovers from changed host key | yes | no |
@@ -183,7 +187,11 @@ No. It deletes local key pair and `~/.ssh/config` entry. Line in the device's `a
183
187
 
184
188
  ### What devices are supported?
185
189
 
186
- Any Linux device reachable over SSH: Raspberry Pi, NVIDIA Jetson, Orange Pi, VMs, servers. Any RouterOS 7.12 or newer device, MikroTik routers or CHR alike, is detected from SSH banner and gets its own key import, `--os routeros` forces it.
190
+ Any Linux device reachable over SSH: Raspberry Pi, NVIDIA Jetson, Orange Pi, VMs, servers. Any distribution works (Raspberry Pi OS, DietPi, Ubuntu and others). Any RouterOS 7.12 or newer device, MikroTik routers or CHR alike, is detected from SSH banner and gets its own key import, `--os routeros` forces it.
191
+
192
+ ### Can I use an RSA key instead of Ed25519?
193
+
194
+ Yes. `--key-type rsa` generates a 4096-bit RSA key for devices or policies that will not take Ed25519. Keys carry their type in the name, `id_ed25519_mypi` or `id_rsa_mypi`, so switching type for an alias leaves the old key alone and ssh-keyup offers to delete it once the new one is verified working.
187
195
 
188
196
  ### How do I add an SSH key to a MikroTik router from Windows?
189
197
 
@@ -199,4 +207,4 @@ Works, with two password prompts and the default key shared across devices again
199
207
 
200
208
  ### Why does RouterOS refuse my password over SSH after adding a key?
201
209
 
202
- That is the default: once a user has a key, RouterOS stops accepting that user's password over SSH. WinBox and WebFig are unaffected, and password SSH can be turned back on under `/ip/ssh`.
210
+ That is the default: once a user has a key, RouterOS stops accepting that user's password over SSH. WinBox and WebFig are unaffected. `/ip/ssh/set password-authentication=yes` turns password SSH back on (`always-allow-password-login=yes` on 7.20 and older).