An open API service indexing awesome lists of open source software.

https://github.com/meibraransari/ubuntu-ssh-enabled

๐Ÿ’ป Unlock the power of SSH with this Ubuntu image, perfect for testing and development! ๐Ÿ› ๏ธ
https://github.com/meibraransari/ubuntu-ssh-enabled

ssh-server ubuntu ubuntu-server

Last synced: 3 months ago
JSON representation

๐Ÿ’ป Unlock the power of SSH with this Ubuntu image, perfect for testing and development! ๐Ÿ› ๏ธ

Awesome Lists containing this project

README

          

---
Created: 2024-07-27T14:01:27+05:30
Updated: 2024-07-31T16:28:10+05:30
Maintainer: 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 ๐Ÿ‘‡๐Ÿ‘‡ ๐Ÿ˜Š

- ๐Ÿ”ฅ [**Youtube**](https://www.youtube.com/@DevOpsinAction?sub_confirmation=1)
- โœ [**Blog**](https://ibraransari.blogspot.com/)
- ๐Ÿ’ผ [**LinkedIn**](https://www.linkedin.com/in/ansariibrar/)
- ๐Ÿ‘จโ€๐Ÿ’ป [**Github**](https://github.com/meibraransari?tab=repositories)
- ๐Ÿ’ฌ [**Telegram**](https://t.me/DevOpsinActionTelegram)
- ๐Ÿณ [**Docker**](https://hub.docker.com/u/ibraransaridocker)