1
0
Fork 0
knowledge-base/KB/Linux/Server/Hetzner/Storagebox.md

34 lines
1 KiB
Markdown
Raw Normal View History

2022-09-04 12:54:22 +00:00
---
creation date: 2022-01-08
2023-11-23 13:37:11 +00:00
tags: [note,linux,hetzner,storage,disk]
2022-09-04 12:54:22 +00:00
---
2023-03-25 11:12:08 +00:00
See https://docs.hetzner.com/robot/storage-box/backup-space-ssh-keys.
2022-09-04 12:54:22 +00:00
2023-03-25 11:12:08 +00:00
## Add existing keys or convert format to RFC
**Use both mechanisms (RFC and standard) for maximum compatibility.**
Example how `.ssh/authorized_keys` might look:
```shell
ssh-rsa AA.... user@host
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "2048-bit RSA, converted by user@host from OpenSSH"
AA.....
---- END SSH2 PUBLIC KEY ----
```
**Use https://docs.hetzner.com/robot/storage-box/backup-space-ssh-keys#converting-your-key-to-rfc4716-format!**
## Create a compatible ssh key and transfer to the user
2022-09-04 12:54:22 +00:00
2023-03-29 16:16:29 +00:00
```shell
2022-09-04 12:54:22 +00:00
ssh-keygen-rsa id_rsa
ssh-keygen -e -f .ssh/id_rsa.pub | grep -v "Comment:" > .ssh/id_rsa_rfc.pub
cat .ssh/id_rsa.pub >> storagebox_authorized_keys
cat .ssh/id_rsa_rfc.pub >> storagebox_authorized_keys
echo -e "mkdir .ssh \n chmod 700 .ssh \n put storagebox_authorized_keys .ssh/authorized_keys \n chmod 600 .ssh/authorized_keys" | sftp ...@....your-storagebox.de
```