0
0
Fork 0
mirror of https://github.com/atmoz/sftp.git synced 2024-11-17 12:51:33 -05:00

Update README.md

This commit is contained in:
Adrian Dvergsdal 2017-06-25 01:42:02 +02:00
parent e2e83abd9f
commit fe107107af

View file

@ -103,10 +103,13 @@ docker run \
Tip: you can use [atmoz/makepasswd](https://hub.docker.com/r/atmoz/makepasswd/) to generate encrypted passwords: Tip: you can use [atmoz/makepasswd](https://hub.docker.com/r/atmoz/makepasswd/) to generate encrypted passwords:
`echo -n "your-password" | docker run -i --rm atmoz/makepasswd --crypt-md5 --clearfrom=-` `echo -n "your-password" | docker run -i --rm atmoz/makepasswd --crypt-md5 --clearfrom=-`
## Using SSH key (and no password) ## Logging in with SSH keys
Mount all public keys in the user's `.ssh/keys/` directory. All keys are automatically Mount public keys in the user's `.ssh/keys/` directory. All keys are
appended to `.ssh/authorized_keys`. automatically appended to `.ssh/authorized_keys` (you can't mount this file
directly, because OpenSSH requires limited file permissions). In this example,
we do not provide any password, so the user `foo` can only login with his SSH
key.
``` ```
docker run \ docker run \
@ -117,9 +120,11 @@ docker run \
foo::1001 foo::1001
``` ```
## Using custom SSH key for server ## Providing your own SSH host key
This container will generate an ssh-key for OpenSSH at first run. To avoid this, you can map Ed25519 or RSA keys from the host inside the container. This container will generate new SSH host keys at first run. To avoid that your
users get a MITM warning when you recreate your container (and the host keys
changes), you can mount your own host keys.
``` ```
docker run \ docker run \
@ -130,7 +135,8 @@ docker run \
foo::1001 foo::1001
``` ```
Tip: you can generate keys with this commands: Tip: you can generate your keys with these commands:
``` ```
ssh-keygen -t ed25519 -f /host/ssh_host_ed25519_key < /dev/null ssh-keygen -t ed25519 -f /host/ssh_host_ed25519_key < /dev/null
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key < /dev/null ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key < /dev/null