wiki/pages/sshkeys.md

186 lines
5.4 KiB
Markdown
Raw Permalink Normal View History

2019-05-09 07:35:16 +00:00
<!--
title: RadioFreqs.space Guide to SSH Keys
-->
# SSH Keys
2019-06-07 02:40:15 +00:00
## how to make an ssh key
2019-11-19 19:09:31 +00:00
SSH supports a handful of types of cryptographic keys. The most used are [RSA](https://en.wikipedia.org/wiki/RSA_%28cryptosystem%29) and the more modern [Ed25519](https://en.wikipedia.org/wiki/EdDSA#Ed25519).
2019-06-07 02:40:15 +00:00
2019-11-19 19:09:31 +00:00
RSA is the de-facto standard and is supported everywhere (just choose a big enough key like 4096bits to be secure). Ed25519 is designed to be faster and smaller without sacrificing security, so is best suited for embedded devices or machines with low resources. It's supported on tilde (and really on any modern system) but you may find older systems which do not support it.
2019-06-07 02:40:15 +00:00
Below you'll find instructions to generate either type (or both if you want).
Keep in mind that these instructions leave your private keys unencrypted in your local hard disk. So keep them private; never share them.
A good solution is to provide a password for them at creation time, but this implies entering a password any time you used them (impractical) or use something like [ssh-agent](https://man.openbsd.org/ssh-agent.1) (a bit more complex)
2019-11-19 19:09:31 +00:00
We don't have documentation for this [(yet)](https://tildegit.org/radiofreqs/wiki/src/branch/master/pages) so either go with no password keys, or ask on IRC ([#radiofreqs](https://web.tilde.chat/?join=radiofreqs)) for help.
2019-06-07 02:40:15 +00:00
pick your fighter: [[mac](#mac)] | [[windows](#windows)] | [[linux](#linux)]
---
### mac
#### generating your keypair
1. open terminal (it's in `/Applications/Utilities`)
1. create your .ssh directory:
```bash
mkdir -m 700 ~/.ssh
```
1. create your keys:
for rsa keys:
```bash
ssh-keygen -t rsa -b 4096
```
2019-11-19 19:09:31 +00:00
for ed25519 keys:
2019-06-07 02:40:15 +00:00
```bash
ssh-keygen -t ed25519 -a 100
```
1. if you press enter to accept the defaults, your public and private key will be located at `~/.ssh/id_rsa.pub` and `~/.ssh/id_rsa` respectively (or `~/.ssh/id_ed25519.pub` and `~/.ssh/id_ed25519` if you chose ed25519 type)
1. `cat ~/.ssh/id_rsa.pub` (or `cat ~/.ssh/id_ed25519.pub` for ed25519)
2019-11-19 19:09:31 +00:00
1. copy the output of the last command and paste it in the sshkey field on the signup form (or email it to [admins](mailto:admins@radiofreqs.space) if you already have an account)
2019-06-07 02:40:15 +00:00
#### using your keypair
2019-11-19 19:09:31 +00:00
once nonlinear or another admin approves your signup, you can join radiofreqs.space
2019-06-07 02:40:15 +00:00
1. open terminal (it's in `/Applications/Utilities`)
2019-11-19 19:09:31 +00:00
1. `ssh` to radiofreqs.space:
2019-06-07 02:40:15 +00:00
```bash
2019-11-19 19:09:31 +00:00
ssh username@radiofreqs.space
2019-06-07 02:40:15 +00:00
```
2019-11-19 19:09:31 +00:00
where username is your username (nonlinear would use `ssh
nonlinear@radiofreqs.space`)
2019-06-07 02:40:15 +00:00
1. profit???
---
### windows
there are a couple options for using ssh on windows these days. i like to use [git bash](https://git-scm.com).
#### generating your keypair
choose from any of the following options:
- [windows subsystem for linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
- [msys2](http://www.msys2.org/)
- [git bash](https://git-scm.com)
1. open your new shell
1. create your .ssh directory
```bash
mkdir .ssh
```
1. create your keypair
for rsa keys:
```bash
ssh-keygen -t rsa -b 4096
```
for ed25519 keys:
```bash
ssh-keygen -t ed25519 -a 100
```
1. if you press enter to accept the defaults, your public and private key will be located at `~/.ssh/id_rsa.pub` and `~/.ssh/id_rsa` respectively (or `~/.ssh/id_ed25519.pub` and `~/.ssh/id_ed25519` if you chose ed25519 type)
1. `cat ~/.ssh/id_rsa.pub` (or `cat ~/.ssh/id_ed25519.pub` for ed25519)
2019-11-19 19:09:31 +00:00
1. copy the output of the last command and paste it in the sshkey field on the signup form (or email it to [admins](mailto:admins@radiofreqs.space) if you already have an account)
2019-06-07 02:40:15 +00:00
#### using your keypair
2019-11-19 19:09:31 +00:00
once nonlinear or another admin approves your signup, you can join radiofreqs.space
2019-06-07 02:40:15 +00:00
1. open terminal (it's in `/Applications/Utilities`)
2019-11-19 19:09:31 +00:00
1. `ssh` to radiofreqs.space:
2019-06-07 02:40:15 +00:00
```bash
2019-11-19 19:09:31 +00:00
ssh username@radiofreqs.space
2019-06-07 02:40:15 +00:00
```
2019-11-19 19:09:31 +00:00
where username is your username (nonlinear would use `ssh nonlinear@radiofreqs.space`)
2019-06-07 02:40:15 +00:00
1. profit???
---
### linux
there are a lot of linux distros, but `ssh` and `ssh-keygen` should be available in almost all cases. if they're not, look up how to install ssh for your distro.
#### generating your keypair
1. make sure you have a `~/.ssh` directory
```bash
mkdir -m 700 ~/.ssh
```
1. create your keys
for rsa keys:
```bash
ssh-keygen -t rsa -b 4096
```
for ed25519 keys:
```bash
ssh-keygen -t ed25519 -a 100
```
1. if you press enter to accept the defaults, your public and private key will be located at `~/.ssh/id_rsa.pub` and `~/.ssh/id_rsa` respectively (or `~/.ssh/id_ed25519.pub` and `~/.ssh/id_ed25519` if you chose ed25519 type)
1. `cat ~/.ssh/id_rsa.pub` (or `cat ~/.ssh/id_ed25519.pub` for ed25519)
2019-11-19 19:09:31 +00:00
1. copy the output of the last command and paste it in the sshkey field on the signup form (or email it to [admins](mailto:admins@radiofreqs.space) if you already have an account)
2019-06-07 02:40:15 +00:00
#### using your keypair
2019-11-19 19:09:31 +00:00
once nonlinear or another admin approves your signup, you can join radiofreqs.space
2019-06-07 02:40:15 +00:00
1. open a terminal (this depends on your distro)
2019-11-19 19:09:31 +00:00
1. `ssh` to radiofreqs.space:
2019-06-07 02:40:15 +00:00
```bash
2019-11-19 19:09:31 +00:00
ssh username@radiofreqs.space
2019-06-07 02:40:15 +00:00
```
2019-11-19 19:09:31 +00:00
where username is your username (nonlinear would use `ssh nonlinear@radiofreqs.space`)
2019-06-07 02:40:15 +00:00
1. profit???
---
2019-11-19 19:09:31 +00:00
this tutorial is taken from [radiofreqs.space ssh wiki page](https://radiofreqs.space/wiki/?page=ssh) uses parts of [the tilde.club ssh primer](https://github.com/tildeclub/tilde.club/blob/master/docs/ssh.md) and [the tilde.town ssh guide](https://tilde.town/wiki/ssh.html).
2019-05-09 07:35:16 +00:00
[back](/)