π¨ Note => This is designed for educational πand testing purposes not suitable for Prod π
1.2K
This Docker image is built on Ubuntu 22.04 and comes pre-installed with an SSH server, enabling seamless creation of SSH-accessible containers. You can effortlessly configure access using SSH keys or by utilizing a default username and password.
ssh-keygen -t rsa -f ~/.ssh/ansible_id_rsa_key -b 4096 -C "This is used for ansible" -N ""
ls -alsh ~/.ssh/
docker pull ibraransaridocker/ubuntu-ssh-enabled:latest
container_name=server_1
ssh_user=ibrar_ansari
ssh_pass=your_secure_password
ssh_port=2023
container_image=ibraransaridocker/ubuntu-ssh-enabled:latest
key_path=~/.ssh/ansible_id_rsa_key.pub
docker run -itd --name=$container_name -p $ssh_port:22 -e SSH_USERNAME=$ssh_user -e PASSWORD=$ssh_pass -e AUTHORIZED_KEYS="$(cat $key_path)" $container_image
hostname=$(hostname -I | awk '{print $1}')
ssh -i ~/.ssh/ansible_id_rsa_key -p $ssh_port $ssh_user@$hostname
ssh -p $ssh_port $ssh_user@$hostname
Content type
Image
Digest
sha256:b5165ee11β¦
Size
104.5 MB
Last updated
about 2 years ago
docker pull ibraransaridocker/ubuntu-ssh-enabled