ita*_*sdf 7 ssh azure docker azure-app-service-plans azure-web-app-service
我正在尝试通过 ssh 连接到 Azure 应用程序服务的容器。我已按照此处配置容器的说明进行操作:
https://learn.microsoft.com/en-gb/azure/app-service/containers/configure-custom-container#enable-ssh
以及此处的连接说明:
https://learn.microsoft.com/en-gb/azure/app-service/containers/app-service-linux-ssh-support
以下是我的 docker 文件中的相关步骤:
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get update \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "root:Docker!" | chpasswd
EXPOSE 8000 2222
COPY sshd_config /etc/ssh/
CMD ./bin/start.sh
Run Code Online (Sandbox Code Playgroud)
start.sh 启动的位置运行服务 ssh start。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,aes128-ctr,aes192-ctr,aes256-ctr
MACs hmac-sha1,hmac-sha1-96
StrictModes yes
SyslogFacility DAEMON
PasswordAuthentication yes
PermitEmptyPasswords no
PermitRootLogin yes
Subsystem sftp internal-sftp
Run Code Online (Sandbox Code Playgroud)
当我尝试通过 ssh 从门户进行连接时,它首先显示“"CONNECTED | CREDENTIALS"然后 30 秒左右”后显示"SSH CONNECTION CLOSE - Error: connect ECONNREFUSED <ip>:2222"
不确定为什么无法连接?
| 归档时间: |
|
| 查看次数: |
13445 次 |
| 最近记录: |