Cannot use rsync for ssh with colon in username
I am trying to use run targets with a SSH server. There is an option to use rsync, unfortunately my ssh username has colon in them and rsync will parse them incorrectly.

This is the error details
rsync -n -e "ssh -p 22" <usernameBeforeColon>:<usernameAfterColon>@<sshHost>:
ssh: Could not resolve hostname <usernameBeforeColon<: nodename nor servname provided, or not known
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(231) [Receiver=3.3.0]
I confirmed that the rsync works if I am using the -l parameter for rsync, like so
rsync -n -e "ssh -p 22 -l <usernameBeforeColon>:<usernameAfterColon>" <sshHost>:
ssh: Could not resolve hostname <usernameBeforeColon<: nodename nor servname provided, or not known
Are there other way to make this works?
Please sign in to leave a comment.
Hi Garyteofanus ! Thank you for your question. Could you please try to encode the colon in the username? A format like this
%3A
replaces the colon (:
).As a result, you should get something like
rsync -n -e "ssh -p 22" <usernameBeforeColon>%3A<usernameAfterColon>@<sshHost>: