Sign inSign up

mythkuang/alpine-ssh

By mythkuang

Updated almost 8 years ago

安装好ssh服务的alpine

Image
0

200

mythkuang/alpine-ssh repository overview

使用百度云镜像 docker pull hub.baidubce.com/mythos/alpine-ssh:1.0

从Dockerfile构建

docker build -t alpine-ssh .

运行容器

docker run --name sshd -p 8989:22 alpine-ssh

建议构建运行后修改口令

docker exec -it sshd passwd
ssh root@localhost -p 8989

Dockerfile

base on alpine:3.8

FROM alpine:3.8
MAINTAINER mythos "[email protected]"

RUN apk add --no-cache openssh-server \
        && ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key \
        && ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key \
        && ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key \
        && ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key \
        && echo "PermitRootLogin yes" >> /etc/ssh/sshd_config \
        && echo "root:caishi" | chpasswd

EXPOSE 22
ENTRYPOINT /usr/sbin/sshd -D

Tag summary

Content type

Image

Digest

Size

2.6 MB

Last updated

almost 8 years ago

docker pull mythkuang/alpine-ssh