apcuk
apcuk

Reputation: 204

rsync through ssh cannot find uppercase remote host (an other container in Docker)

I'm running docker containers on a host, all of them in one bridge network. I'm using rsync among others to transfer data between them. I have CamelCase container names. I have no problem connecting to other running containers with these names from a Java application through REST for example, but rsync/ssh cannot handle them.

root@container-id:/# rsync -av /sourceFolder user@CamelCaseContainer:/targetFolder

ssh: Could not resolve hostname camelcasecontainer: Name or service not known
rsync: connection unexpectedly closed (0 bytes received so far) [sender]

So for whatever reason, it changes the hostname to lowercase, and of course this way it cannot find the remote machine. If I want to connect to a container that has no uppercase letters in its name, everything is fine. (My images have a Debian base layer and the docker host is Ubuntu.)

Why is that?

Upvotes: 0

Views: 462

Answers (1)

Jakuje
Jakuje

Reputation: 25966

OpenSSH is trying to resolve the hostname to IP address using DNS and it is not case sensitive.

It depends on what service is resolving your DNS names, but most likely there will be some bug. OpenSSH does it the expected way.

Upvotes: 1

Related Questions