bashsshdocker

Why set VISIBLE=NOW in /etc/profile?


I'm reading a Dockerfile - Dockerizing an SSH Service and it contains the following code:

 ENV NOTVISIBLE "in users profile"
 RUN echo "export VISIBLE=now" >> /etc/profile

Just curious what the purpose of that is?

TIA, Ole

P.S Great article here on ways to avoid running an SSH Server in a Docker container: https://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/


Solution

  • It's an example of how to pass environment variables when running a Dockerized SSHD service. SSHD scrubs the environment, therefore ENV variables contained in Dockerfile must be pushed to /etc/profile in order for them to be available.