Skip to content

Commit 436b70d

Browse files
committed
update README.MD for bastion and ssh config
1 parent 3fd6a8d commit 436b70d

File tree

3 files changed

+36
-9
lines changed

3 files changed

+36
-9
lines changed

README.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The aim of the project is to establish a robust and localized development enviro
3232
The [`docker-compose.yml`](docker-compose.yml) file defines the following
3333
containers:
3434

35-
- WIP: Bastion (SSH jump server)
35+
- **bastion-dev** - Bastion (SSH jump server)
3636
- **ansible-dev** - Ansible
3737
- **web-dev** - Web server (Apache2/WordPress)
3838
- **db-dev** - Database server (MariaDB)
@@ -89,6 +89,32 @@ The SSH setup has been established and is currently in use for the Ansible conta
8989
ssh -i ./sysadmin-ssh-keys/rsa_sysadmin -p 22001 sysadmin@localhost
9090
```
9191

92+
**SSH connection information**: example local/laptop `~/.ssh/config` configugration
93+
```
94+
Host ansible-dev
95+
HostName localhost
96+
User sysadmin
97+
Port 22222
98+
IdentityFile /home/sysadmin/.ssh/id_rsa
99+
ProxyJump bastion
100+
101+
Host web-dev
102+
HostName localhost
103+
User sysadmin
104+
Port 22001
105+
IdentityFile /home/sysadmin/.ssh/id_rsa
106+
ProxyJump bastion
107+
108+
Host bastion-dev
109+
HostName localhost
110+
Port 22002
111+
User sysadmin
112+
IdentityFile /home/sysadmin/.ssh/id_rsa
113+
```
114+
- Assume remote username `sysadmin`. Replace these values in your own local/laptop configuration.
115+
- ProxyJump allow you to use `ssh bastion` to connect to the bastion-dev host, and `ssh ansible-dev` or `ssh web-dev`, and SSH will automatically connect through the bastion jump host.
116+
117+
92118
## Related Links
93119
- [Ansible Documentation](https://docs.ansible.com/)
94120
- [FrontPage - Debian Wiki](https://wiki.debian.org/FrontPage)

bastion/sysadmin-.ssh-config/config

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
Host ansible-dev
2-
HostName ansible-dev
2+
HostName localhost
33
User sysadmin
4+
Port 22222
45
IdentityFile /home/sysadmin/.ssh/id_rsa
56
ProxyJump bastion
67

78
Host web-dev
8-
HostName web-dev
9+
HostName localhost
910
User sysadmin
11+
Port 22001
1012
IdentityFile /home/sysadmin/.ssh/id_rsa
1113
ProxyJump bastion
1214

13-
Host bastion
14-
HostName bastion-dev
15-
User sysadmin
16-
IdentityFile /home/sysadmin/.ssh/id_rsa
15+
Host bastion-dev
16+
HostName localhost
17+
Port 22002
18+
User sysadmin
19+
IdentityFile /home/sysadmin/.ssh/id_rsa

docker-compose.yml

-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ services:
8787
- ./sysadmin-ssh-keys/rsa_sysadmin:/home/sysadmin/.ssh/id_rsa:ro
8888
- ./sysadmin-ssh-keys/rsa_sysadmin.pub:/home/sysadmin/.ssh/id_rsa.pub:ro
8989
- ./sysadmin-ssh-keys/rsa_sysadmin.pub:/home/sysadmin/.ssh/authorized_keys:ro
90-
- ./bastion/etc-bastion-config/config:/home/sysadmin/.ssh/config:ro
91-
9290

9391
volumes:
9492
db-data:

0 commit comments

Comments
 (0)