I would like to ask you for some help. How can I use an scp task when my username contains an @ sign?
I tried to escape the character in many ways but it isn't working. In the following example, my username is user@host.com
<scp file="test.txt" todir=""user@host.com":password@ftp.host.com:/" trust="true" sftp="true"/>
<scp file="test.txt" todir="'user@host.com':password@ftp.host.com:/" trust="true" sftp="true"/>
<scp file="test.txt" todir="user\@host.com:password@ftp.host.com:/" trust="true" sftp="true"/>
But the output is always the same:
neither password nor keyfile for user "user has been given. Can't authenticate.
Please, is there anyway to force the task to parse this string correctly? Thank you very much.
By the way, I don't know why but with my current provider it is impossible to create a username without appending the hostname.
I use the SCP task in my build.xml and it's form looks like this:
Looking at the source of the SCP Task at the function
parseUri(String uri)
(line 370) it appears that the task can support a username with a @ symbol. The restrictions appear to be with paths that have a : or @ in them as seen by this comment:The code doesn't seem to support this comment (as pointed out by martin clayton). You can also see the error you are referring which is triggered when the password or the keyfile is missing. Maybe the combination of a password in
user:password@host:/path
notation and a username with an @ is causing problems?Present ant version
-1.9.4
operating system:-16.04 Ubuntu
did not work.Changed to
1.9.3
and pointed to/usr/bin/ant
ssh was successful observation: