博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
docker 允许主机ssh到docker容器中
阅读量:4287 次
发布时间:2019-05-27

本文共 383 字,大约阅读时间需要 1 分钟。

在docker容器中,安装好ssh:

1)替换掉容器中的安装源为163源

2)安装ssh服务

apt-get updateapt-get install openssh-server
3)添加目录,修改ssh配置文件

mkdir -p /var/run/sshdvim /etc/pam.d/sshd 找到 session    required     pam_loginuid.so 这一行,将它注释掉
4)添加要链接过来的主机公钥

将公钥放到/root/.ssh/authorized_key中

接下来就是在宿主机上启动容器,分配端口,启用ssh服务:

docker run -p 10022:22 -d sshd:ubuntu /usr/sbin/sshd -D
尝试链接:

ssh 192.168.163.131 -p 10022
ip 为容器的宿主机ip

转载地址:http://dcxgi.baihongyu.com/

你可能感兴趣的文章
NAACL2021阅读理解论文整理
查看>>
论文笔记 | Leveraging Graph to Improve Abstractive Multi-Document Summarization
查看>>
NAACL2021丨Knowledge Guided Metric Learning for Few-Shot Text Classification
查看>>
论文笔记|Deep Open Intent Classification with Adaptive Decision Boundary
查看>>
【论文笔记】
查看>>
论文笔记_Pay Attention to MLPs
查看>>
【论文笔记】
查看>>
论文笔记
查看>>
论文笔记 | Attention-based LSTM for Aspect-level Sentiment Classification
查看>>
【论文笔记】Joint Extraction of Entities and Relations Based on a Novel Tagging Scheme
查看>>
论文笔记|Bidirectional LSTM-CRF Models for Sequence Tagging
查看>>
论文笔记:Constructing Narrative Event Evolutionary Graph for Script Event Prediction
查看>>
论文笔记丨Open Hierarchical Relation Extraction
查看>>
论文笔记| BART:Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation
查看>>
【论文笔记】 | Learning to Retrieve Reasoning Paths over Wikipedia Graph for Question Answering
查看>>
论文笔记 | Adversarial Examples for Evaluating Reading Comprehension Systems
查看>>
2021-06-12
查看>>
论文笔记| The Emergence, Advancement and Future of Textual Answer Triggering
查看>>
论文笔记|Open Set Text Classification using Convolutional Neural Networks
查看>>
论文笔记: Hierarchical Chinese Legal event extraction via Pedal Attention Mechanism
查看>>