improve the ssh keygen docs
This commit is contained in:
parent
170e17bdd1
commit
3d5613d235
30
README.md
30
README.md
@ -3,15 +3,37 @@ This is currently WIP btw.
|
|||||||
|
|
||||||
* Install restic > 1.14
|
* Install restic > 1.14
|
||||||
* Create new repository (where backups are stored)
|
* Create new repository (where backups are stored)
|
||||||
* Create a new ssh keypair and share it with the remote host
|
|
||||||
* Create a `~/.ssh/config` file and name it. In this case we will name it `other`
|
Create a new ssh keypair, in this example I'm naming the keyfile "keyfile"
|
||||||
|
```bash
|
||||||
|
ssh-keygen -f ~/.ssh/keyfile
|
||||||
|
```
|
||||||
|
|
||||||
|
Share the key it with the remote host
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh-copy-id -i ~/.ssh/keyfile.pub admin@192.168.1.20
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a `~/.ssh/config` file and name it. In this case we will name it "remote"
|
||||||
|
|
||||||
|
```toml
|
||||||
|
# ~/.ssh/config
|
||||||
|
Host remote
|
||||||
|
Hostname 192.168.1.20 # example
|
||||||
|
User admin
|
||||||
|
IdentityFile ~/.ssh/keyfile
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# This could also be a local folder (/to/whereever/) but that's dumb.
|
# This could also be a local folder (/to/whereever/) but that's dumb.
|
||||||
export RESTIC_REPOSITORY="sftp:other:/srv/repo"
|
export RESTIC_REPOSITORY="sftp:remote:/srv/repo"
|
||||||
restic init
|
restic init
|
||||||
# It will ask you for a password, ofc make this good and don't forget it.
|
# It will ask you for a password, ofc make this good and don't forget it.
|
||||||
```
|
```
|
||||||
* Backup some files
|
|
||||||
|
Backup some files
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Set $TMPDIR to somewhere on a tmpfs filesystem to reduce drive wear
|
# Set $TMPDIR to somewhere on a tmpfs filesystem to reduce drive wear
|
||||||
# Optionally add the `--tag foo` flag to tag backup snapshots
|
# Optionally add the `--tag foo` flag to tag backup snapshots
|
||||||
|
Loading…
Reference in New Issue
Block a user