Skip to content

πŸ’» Unlock the power of SSH with this Ubuntu image, perfect for testing and development! πŸ› οΈ

Notifications You must be signed in to change notification settings

meibraransari/ubuntu-ssh-enabled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Created Updated Maintainer
2024-07-27 14:01:27 +0530
2024-07-31 16:28:10 +0530
Ibrar Ansari

Ubuntu SSH Enabled

πŸ“’πŸ“’πŸ“’ Attention all Docker 🐳 Beginners & Professionals! 🎯

Docker Pulls Kubernetes Goat

πŸ’» Unlock the power of SSH with this Ubuntu image, perfect for testing and development! πŸ› οΈ

🚨 Please note: This image is designed for educational and testing purposes πŸ“š πŸ§ͺ ONLY! It is NOT SUITABLE for production environments! 🚫

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.

Step 1: Create Authentication SSH-Keygen Keys.

ssh-keygen -t rsa -f ~/.ssh/ansible_id_rsa_key -b 4096 -C "This is used for ansible" -N ""
ls -alsh ~/.ssh/

Step 2: Pull docker image

docker pull ibraransaridocker/ubuntu-ssh-enabled:latest

Step 3: Set variables to run the docker container.

Change πŸ‘‡ variables(containername, username, password & port) according to your need.

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

Step 4: Run docker container.

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

Step 5: Test SSH connection

Get Node IP:

hostname=$(hostname -I | awk '{print $1}')

Pem Key Method:

ssh -i ~/.ssh/ansible_id_rsa_key -p $ssh_port $ssh_user@$hostname

Password Method:

ssh -p $ssh_port $ssh_user@$hostname

πŸ’Ό Connect with me πŸ‘‡πŸ‘‡ 😊

About

πŸ’» Unlock the power of SSH with this Ubuntu image, perfect for testing and development! πŸ› οΈ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published