Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running WebTunnelAgent in docker #92

Open
nhi-vanye opened this issue Nov 8, 2018 · 3 comments
Open

Running WebTunnelAgent in docker #92

nhi-vanye opened this issue Nov 8, 2018 · 3 comments

Comments

@nhi-vanye
Copy link

I'm looking to run the WebTunnelAgent (as proof of concept) in a container and I'm getting confused about the port mapping in docker vs the ports in the agent.

My use case is to support remote management (ssh) of a software appliance that comprises a number of containers in a VM. Adding a container to run the remote agent is preferred to running the agent on the host itself.

How does the webtunnel.host relate to the container ? Using 127.0.0.1 means the container, should this be the host ip address instead.

Have people been running this on the host network or using port mapping ?

I'm assuming that I need the ssh binary in the docker container, but do I need sshd as well ?

I think I've tried the various combinations but no success - it seems that there has been some communication because it (WebTunnelSSH) seems to fail at ssh handshake.

@obiltschnig
Copy link
Member

Interesting use case. You'll have to see all IP addresses and ports from the point of your container running WebTunnelAgent. So if you need to access a different container's shell via ssh, you'll have to make that container's SSH port visible/accessible to the container running WebTunnelAgent. Try running ssh from the WebTunnelAgent container to your application's container, and note the IP address and port number used. Then use that IP address for webtunnel.host in your WebTunnelAgent.properties file. If the application container's SSH port is mapped to a different port, or a port other than default 22 in your container, make sure that this port number is included in the webtunnel.ports setting.

When running WebTunnelSSH, make sure to specify your device's URI (take the URI from the link under the device name in the Remote Manager Dashboard). If the target SSH port is not 22, use the --remote-port or -R option to specify it when running WebTunnelSSH.

Hope this helps.

@nhi-vanye
Copy link
Author

Yes it did Gunther. Thanks

What I needed to do was make sure I was using the correct SSH keys at both the WebTunnelAgent and WebTunnelSSH (only public/private keys are used throughout my configuration) - I think my issues was that I didn't have a valid set of (public and private) keys inside the container so that when it initiated the outgoing ssh connection to the host it had to fall back to password auth. I was stupid in that I kept thinking it was trying to use passwords to access the sshd in the container...

Any chance of adding support for description or tags as properties on WebTunnelAgent that can be set without needing to compile. I can do a pull request but am not sure which of the various repositories is the master for WebTunnelAgent...

@obiltschnig
Copy link
Member

Yes, I will add a feature to set arbitrary device properties including tags to the SDK this week. For now, master repository for the Remote Manager SDK is still https://github.com/my-devices/sdk. This will probably consolidated to the macchina-io organization at one point in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants