您的位置:首页 > 运维架构 > Docker

Azure: Custom Docker Image support SSH on Web App on Linux

2017-06-07 14:30 841 查看

概览

web app on linux: azure 提供的一种原生linux操作系统

SSH: 为了网络服务安全的一种网络加密协议,多用来确保远程登录系统的安全

https://zh.wikipedia.org/wiki/Secure_Shell

Docker image: 支持SSH后,可以访问azuer上运行状态的image,

类似于docker exec -it imagename bash

访问地址:https:// yoursitename.scm.azurewebsites.net /webssh/host

Docker Image Code

Dockerfile

# ------------------------
# SSH Server support
# ------------------------
RUN apt-get update \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "root:Docker!" | chpasswd
...
COPY sshd_config /etc/ssh/
...
EXPOSE 2222


sshd_config

# This is ssh server systemwide configuration file.
#
# /etc/sshd_config

Port            2222
ListenAddress       0.0.0.0
LoginGraceTime      180
X11Forwarding       yes
Ciphers aes128-cbc,3des-cbc,aes256-cbc
MACs hmac-sha1,hmac-sha1-96
StrictModes         yes
SyslogFacility      DAEMON
PrintMotd             no
IgnoreRhosts        no
#deprecated option
#RhostsAuthentication   no
RhostsRSAAuthentication yes
RSAAuthentication   no
PasswordAuthentication  yes
PermitEmptyPasswords    no
PermitRootLogin     yes


start ssh service (e.g.entrypoint.sh)

service ssh start


URL

Source Code: https://github.com/Song2017/Microsoft/tree/devapm/docker-library/apache-php-mysql

Document: https://docs.microsoft.com/en-us/azure/app-service-web/app-service-linux-ssh-support
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: