-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Take PUBLIC_SSH_KEY env var instead of authorized_keys mount
- Loading branch information
Showing
2 changed files
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
# ubuntu-sshd-image | ||
# ubuntu-sshd-image | ||
|
||
Ubuntu image with sshd configured for use in testing | ||
|
||
# Usage | ||
|
||
Create a `authorized_keys` file in which you put your public key. Make sure the file is owned by | ||
root and has the permission `644`. | ||
Pass in your public key as an environment variable `PUBLIC_SSH_KEY`. | ||
|
||
```sh | ||
cat ~/.ssh/id_ed25519.pub > authorized_keys | ||
chown root:root authorized_keys | ||
chmod 644 authorized_keys | ||
|
||
docker run \ | ||
--mount type=bind,src=$(pwd)/authorized_keys,dst=/root/.ssh/authorized_keys \ | ||
-e PUBLIC_SSH_KEY="ssh-ed25519 ..." | ||
-p 22:22 \ | ||
-d \ | ||
ubuntu-sshd-image | ||
ghcr.io/fabled-se/ubuntu-sshd-image:latest | ||
``` | ||
|