This repository has been archived by the owner on Mar 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docker): 实现ssh Ubuntu18.04 docker连接,更新文档关于Ubuntu18.04和Ubuntu16.0…
…4的ssh默认设置区别
- Loading branch information
Showing
3 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# $ docker build -t zjzstu/ssh . | ||
# $ docker run -d -P --name test_sshd zjzstu/ssh:latest | ||
FROM zjzstu/ubuntu:18.04 | ||
LABEL maintainer "zhujian <zjzstu@github.com>" | ||
|
||
RUN apt-get update && apt-get install -y openssh-server | ||
RUN mkdir /var/run/sshd && \ | ||
echo 'root:zhujian' | chpasswd && \ | ||
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ | ||
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd | ||
# SSH login fix. Otherwise user is kicked off after login | ||
|
||
EXPOSE 22 | ||
CMD ["/usr/sbin/sshd", "-D"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
参考:[[Docker][SSH]远程登录Ubuntu](https://container-automation.readthedocs.io/zh_CN/latest/docker/advanced/%5BDocker%5D%5BSSH%5D远程登录Ubuntu.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters