...
Code Block |
---|
docker run -d \ --name bastion \ --hostname bastion \ --restart unless-stopped \ -v $PWD/config:/var/lib/bastion \ -v bastion:/usr/etc/ssh:rw \ --add-host docker-host:172.17.0.1 \ -p 22222:22/tcp \ -e "PUBKEY_AUTHENTICATION=true" \ -e "GATEWAY_PORTS=true" \ -e "PERMIT_TUNNEL=true" \ -e "X11_FORWARDING=false" \ -e "TCP_FORWARDING=true" \ -e "AGENT_FORWARDING=true" \ binlab/bastion |
You can attempt a connection to it to verify if the auth setup has been done correctly.
...
ssh
...
-i
...
postgres-ssh.pem
...
-p
...
22222
...
bastion@127.0.0.1
Setting up the Postgres instance
...
Code Block |
---|
psql -h 127.0.0.1 -p 54320 -U postgres -W -d postgres |
...
Connecting the two Containers
...