Simple SSHD container (no systemd)
This image is meant to be used for a ssh login into a container and fiddle around. Sometimes you need these things.
If you are looking for a way to use this container to control a Docker host please use "bacen/carina-sshd" instead.
These variables can be set on "docker run":
This will run the sshd container on port 8022, accepting password "senha" for user "user".
docker run --name sshd -d \
-p 8022:22 \
-e "USERPWD=senha" \
-e "KEYONLY=false" \
bacen/sshd
To test the connection:
ssh user@yourhost -p 8022
This will run the sshd container on port 8022, accepting only key-based logins for user "user". The public key contents were drawn from your local "id_rsa.pub", but you can pick any other, of course.
PUBLICKEY=`cat ~/.ssh/id_rsa.pub`
docker run --name sshd -d \
-p 8022:22 \
-e "PUBLICKEY=$PUBLICKEY" \
-e "KEYONLY=true" \
bacen/sshd:latest
To test the connection with the defautl private key (~/.ssh/id_rsa):
ssh user@yourhost -p 8022
Or, if you want to use another private key:
ssh user@yourhost -p 8022 -i ~/.ssh/anotherkey
You can run the container the fancy way (above) and configure your own ssh client to provide several convenient settings. You must insert this into your local "~/.ssh/config" (please replace "xxx.xxx.xxx.xxx" for your host's IP address):
# Carina host
Host myserver
HostName xxx.xxx.xxx.xxx
Port 8022
User user
# IdentityFile ~/.ssh/anotherkey
With these settings you can connect safer and simpler:
ssh myserver
Content type
Image
Digest
Size
74.4 MB
Last updated
over 10 years ago
docker pull bacen/sshd