docker:SSH直接访问容器 [英] docker: SSH access directly into container

查看:158
本文介绍了docker:SSH直接访问容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我们使用了几个linux用户:




  • system_foo @ server

  • system_bar @服务器

  • ...



我们希望将系统用户放入docker容器。 / p>


  • linux用户 system_foo - > container system_foo



服务器内的更改不成问题,但远程系统使用这些用户向我们发送数据。 p>

我们需要使 ssh system_foo @ server 工作。远程系统无法更改。



如果每个linux操作系统只有一个系统(将端口22传递到容器),我将非常容易。但是有几个。



我们如何从旧的方案更改为docker容器并保留服务 ssh system_foo @ server 在远程站点没有更改可用?



如果您不明白问题,请发表评论。不过,让我们记住,在容器中支持ssh通常是一个反模式(除非它是你的容器) 关心,但是那么能够进行ssh的点呢?请参阅 http://techblog.constantcontact.com/devops/a-tale-of-three-docker-anti-patterns/ 有关该反模式的信息


Up to now we use several linux users:

  • system_foo@server
  • system_bar@server
  • ...

We want to put the system users into docker container.

  • linux user system_foo --> container system_foo

The changes inside the servers are not problem, but remote systems use these users to send us data.

We need to make ssh system_foo@server work. The remote systems can't be changed.

I would be very easy if there would be just one system per linux operating system (pass port 22 to the container). But there are several.

How can we change from the old scheme to docker containers and keep the service ssh system_foo@server available without changes at the remote site?

Please leave a comment if you don't understand the question. Thank you.

解决方案

Let's remember however that having ssh support in a container is typically an anti-pattern (unless it's your container only 'concern' but then what would be the point of being able to ssh in. Refer to http://techblog.constantcontact.com/devops/a-tale-of-three-docker-anti-patterns/ for information about that anti-pattern

这篇关于docker:SSH直接访问容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆