Answer the question
In order to leave comments, you need to log in
How to configure access to guest via ssh?
To start with a goal.
It is necessary to set up 4 nodes, 1 for the test server, the rest for the developers.
I rent a dedicated server, get an ip address and root access.
I have domains dev.ru, n1.dev.ru, n2.dev.ru, n3.dev.ru, ... directed to the received ip I
install docker and create containers, I raise an ssh server on each of the containers, in the machine hosts file I configure dns correspondence of n1-n`n machines to static addresses of guest machines.
For access on port 80, as I understand it, nginx just rises on the host machine, but what about ssh access?
How do I need to configure network interfaces on the host machine and guest1 in order to be able to connect via ssh to users [email protected]@dev.ru:22, [email protected]:22, etc. while getting either on the host machine or guest`n, respectively?
Answer the question
In order to leave comments, you need to log in
No way. There is no such proxy server for ssh, so that it would listen on the gateway on the domain to which you are going to route traffic.
I see 4 options:
1. Buy additional ip and hang them on virtual machines so that each has its own address. Delegate each domain to the corresponding address. This is the simplest and most convenient solution.
2. "Gray" addresses are raised on the containers, in /etc/hosts the system host has the correspondence of the developers' domains to these addresses. Accordingly, the user via ssh first enters your host system (server), and from there to the container via the "gray" network. Not very elegant, but cheap and simple.
3. Resolve all iptables by posting rules on different ports. They knocked on port 2222, got on the first virtual machine, knocked on port 3333, got on the second one. It is configured easily, from the inconvenience of non-standard ports.
4. If there is an office, then somehow link the "gray" network of containers behind the node, with the network with the office. Usually this is done by means of VPN, well, and raise DNS in the office where to delegate domain names to "gray" addresses. Here, as it were, the scheme is not fail-safe, since the network in the office will fall and they will no longer be able to connect to containers in the usual way, and you need to connect from the office network (but if you already have everyone working in it, then this is only a plus).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question