Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/li0ard/ssh2age
Convert SSH ed25519 keys to age keys
https://github.com/li0ard/ssh2age
Last synced: 18 days ago
JSON representation
Convert SSH ed25519 keys to age keys
- Host: GitHub
- URL: https://github.com/li0ard/ssh2age
- Owner: li0ard
- License: mit
- Created: 2023-10-02T04:03:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-02T04:14:54.000Z (over 1 year ago)
- Last Synced: 2024-11-06T04:39:14.394Z (2 months ago)
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ssh2age
Convert SSH ed25519 keys to [age](https://github.com/FiloSottile/age) keys. Just CLI for [ssh-to-age](https://github.com/Mic92/ssh-to-age).
## Usage
- Convert private key (without password)
```console
$ ssh2age -p -i $HOME/.ssh/id_ed25519 -o key.txt
$ cat key.txt
AGE-SECRET-KEY-1K3VN4N03PTHJWSJSCCMQCN33RY5FSKQPJ4KRRTG3JMQUYE0TUSEQEDH6V8
```- Convert private key (with password)
```console
$ ssh2age -p -i $HOME/.ssh/id_ed25519 -o key.txt
Enter SSH key password:
$ cat key.txt
AGE-SECRET-KEY-1K3VN4N03PTHJWSJSCCMQCN33RY5FSKQPJ4KRRTG3JMQUYE0TUSEQEDH6V8
```- Convert public key
```console
$ ssh2age -i $HOME/.ssh/id_ed25519.pub -o pub-key.txt
$ cat pub-key.txt
age17044m9wgakla6pzftf4srtl3h5mcsr85jysgt5fg23zpnta8sfdqhzn452
```ssh2age also supports multiple public keys at once seperated by newlines and ignores unless ssh keys that are not in the ed25519 format. This makes it suiteable in combination with `ssh-keyscan`:
```console
$ curl "https://github.com/orlp.keys" | ssh2age
...
age1m6tk99c7q84g5luktuwve9d7pjz5zdfq7gt7w2rugc9nyn38eamqykdkh9
age164qlju7r0wwvuxgwam328rrk732scce7ds3ktlg5pw57yx5qlywqusqup4
age167f44ulejhgwm4ttrlpwsj99yr2evhgx234gjp5gtccdxmsrju4qrxdz2p
skipped key: got ssh-rsa key type, but only ed25519 keys are supported
age1ar0g7u4fsqpmzlx9u4k9v2k9hyr8642jt5h5jdly3takm4jhcutsh62j7m
```