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

概览

  • 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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值