Last active
October 28, 2020 14:27
-
-
Save caliburn1994/ba20ebaca880e42d86dc54655a20b7ba to your computer and use it in GitHub Desktop.
Docker SSH Server + public key authentication . login as root
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
mkdir data keys public | |
# copy public key to current dir, for safe. | |
cp ${HOME}/.ssh/id_rsa.pub public/ | |
docker run -ti -p 2222:22 \ | |
-v $(pwd)/public/id_rsa.pub:/root/.ssh/authorized_keys \ | |
-v $(pwd)/keys/:/etc/ssh/keys \ | |
-v $(pwd)/data/:/data/ \ | |
-e SSH_ENABLE_ROOT=true \ | |
docker.io/panubo/sshd:1.3.0 |
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
ssh root@localhost -p 2222 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment