I'm connected to Ubuntu server that is a member of a corporate Active Directory domain via likewise-open. The users are in the form mydomain\myuser. I can connect to it via ssh, escaping the \ with another \:

ssh mydomain\\myuser@myserver

I've generated a pair of keys via ssh-keygen, then tried to copy it to the remote machine. The user I'm using in the local machine is not the same I want to copy the key into, so I issued the command:

ssh-copy-id mydomain\\myuser@myserver

and the output:

mydomainyuser@myserver's password:
Received disconnect from myserver: 2: Too many authentication failures for myuserydomain

prompting me for the local user's password three times, and then the \\ actually worked as a single \ escaping the first m in mydomain. Am I getting this straight? And how can I escape that \ and correctly copy key to the remote machine?

EDIT: also ssh-copy-id myuser@mydomain.com@myserver turned out to be a valid syntax.. However, the question was about escaping the \.

1 Answer 1


The reason this is happening is because you are escaping it for the shell, but ssh-copy-id is also attempting to interpret it. This should work:

ssh-copy-id 'mydomain\\myuser@myserver'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.