How do I ssh into the Pi-hole docker

#1

Hi,

I wonder if its possible to ssh into Pi-hole when its running on a docker. I tried adding -p 22:22 but it doesn’t appear to accept ssh.

I know I can call docker exec to execute commands on Pi-hole, but wondered if I could do it with a shell access, or is that not possible with docker?

0 Likes

#2
pi@noads:~ $ cat ~/.bashrc
[..]
alias ddg='surfraw duckduckgo -l'
alias google='surfraw google -l'
[..]

pi@noads:~ $ ddg docker attach

Description

   Attach local standard input, output, and error streams to a running
   container

Usage
https://docs.docker.com/engine/reference/commandline/attach/
0 Likes

#3

Thank you again.
You are having fun with that surfraw command I see. :grin:

0 Likes

#4

Yeah new trick I learned :wink:
SSH into NAS and attach.

0 Likes

#5

Have looksee here bout running SSH in a container:

https://www.twistlock.com/2017/07/06/ultimate-guide-container-security/

Images should contain the bare minimum amount of code necessary to run whichever service or application you are creating the image for. Exclude any non-essential services from the image. For example, in most cases there is no reason to include an SSH server inside a container image because you can log into the container in other, more secure ways. So don’t include SSH.

0 Likes