Skip to content

Instantly share code, notes, and snippets.

@pokle
Created April 16, 2014 04:45
Show Gist options
  • Save pokle/10808069 to your computer and use it in GitHub Desktop.
Save pokle/10808069 to your computer and use it in GitHub Desktop.
Run ssh server inside a Centos/Redhat Docker container
# ssh server
# Don't forget to run '/usr/sbin/sshd -D' if you actually want to ssh into this container
RUN yum install -y openssh-server
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
ADD src/sshd/sshd_config /etc/ssh/sshd_config
RUN echo root:welcome1 | chpasswd
@rocksy1209
Copy link

issue coming
Unable to load host key

@abdennour
Copy link

Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:00:31 ago on Fri Apr 10 00:00:55 2020.
No match for argument: openssh-server
Error: Unable to find a match: openssh-server

@TheReactiveMouse
Copy link

Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:00:31 ago on Fri Apr 10 00:00:55 2020.
No match for argument: openssh-server
Error: Unable to find a match: openssh-server

yum update and can be issue with systemd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment