为了能到远方,脚下的每一步都不能少.|

bitterteaer

园龄:3年8个月粉丝:1关注:0

如何设置SSH远程连接docker容器

@https://blog.csdn.net/hwijew/article/details/88171749
@https://blog.csdn.net/lhyhaiyan/article/details/128546411

安装ssh server

apt-get update
apt-get install openssh-server

启动SSH服务

ssh start

查看SSH服务的状态

service ssh status

设置root密码和配置文件

passwd root
vim /etc/ssh/sshd_config

增加以下内容:

#启用 RSA 认证
RSAAuthentication yes
#启用公钥私钥配对认证方式
PubkeyAuthentication yes
#公钥文件路径(和上面生成的文件同)
AuthorizedKeysFile .ssh/authorized_keys
#root能使用ssh登录
PermitRootLogin yes

重启SSH

service ssh restart

远程连接

ssh root@127.0.0.1 -p 1022

本文作者:bitterteaer

本文链接:https://www.cnblogs.com/bitterteaer/p/17723173.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   bitterteaer  阅读(85)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起