tags:

views:

691

answers:

2

I have a nAnt script that works perfectly to build and copy a website to another domain machine. However, when I try to copy the website to a machine not on the domain I get security errors.

I know it's because the user that I have set to run nAnt doesn't have permissions on the remote computer.

Is it possible to specify a remote user to authenticate against when trying to copy files to a non-domain computer? There doesn't seem to be any options for this in the official nAnt documentation.

What other options are available?

A: 

I answered a question that was similar to this.

One might be able to use the exec task to launch the runas command to copy (or xcopy) the files over to a computer with a different username/password. If this is a non-domain account, you might have to use the local administrator account to authenticate. I'm not 100% on that one.

This should allow you to stay within NAnt. Let me know if this is not sufficient and we can try and figure something else out.

Scott Saad
That does give some ideas, but none that would work easily.I'm not using Team City.SCP uses the username environment variable, but doesn't specify a password.If necessary, I could just use exec to use ftp to deploy everything, but I would rather stick to using nAnt to handle it if I possible.
AaronS
Updated the answer as some of this still might apply to you.
Scott Saad
I think trying to run a local nant as a remote admin and then using xcopy is getting into the same boat as using ftp, just using a different external program. It looks like I may have to go the FTP route.
AaronS
+1  A: 

We've got round this by having a account with the same username and password on all servers that are involved in the copy. However, we do it the other way round. We copy from a machine in a workgroup to a maching in a domain and it works fine.

e.g. useraccount on workgroup computer: .\CruiseControl password1

useraccount on domain: domain\CruiseControl password1

gbanfill
That's not a bad idea. I'll give it a shot.
AaronS
This method worked perfectly.I'm running the nAnt process with a domain account (via Cruise Control), and created a local verion of that domain account on the DMZ server.Thanks for your help!
AaronS