Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker: SSH access directly into container

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.

like image 930
guettli Avatar asked Feb 12 '23 01:02

guettli


1 Answers

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

like image 195
ferik Avatar answered Feb 15 '23 11:02

ferik