Create ssh connection to Docker container

 FROM centos

RUN yum -y install openssh-server

RUN useradd user && \

echo "pass@321" | passwd user --stdin && \

mkdir /home/user/.ssh \

chmod 700 /home/user/.ssh

COPY remote-key.pub /home/user/.ssh/authorized_keys

RUN chown user:user -R /home/user/.ssh && \

chmod 600 /home/user/.ssh/authorized_keys

RUN /usr/sbin/sshd-keygen

CMD /usr/sbin/sshd -D

Share on Google Plus

About Penguin Technology

I am a passionate cloud and DevOps professional specializing in Linux and open-source solutions. Through this blog, I share my knowledge and experience with the community, offering tips and insights on cloud technologies and DevOps practices.
    Blogger Comment

0 comments:

Post a Comment