Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-05-2015, 01:07 PM
Bob Bob is offline
Registered User
 
Join Date: Oct 2015
Posts: 5
Request passphrase twice

Hello,

I have this command :

SFXCL /Q /Log 'D:\Log20151005150316.log' /P 'passphrase' \\bob\file.txt SFTP://user@bob.com:/RepUpload

Even if I specify the passphrase in the command, if the windows application is not open, he request another time the passphrase.

Why ?
Reply With Quote
  #2  
Old 10-05-2015, 01:21 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi Bob,

You have not actually pointed to a specific key file via your command-line. Have you configured Default Session with a key file for public-key authentication?

If not, if you add /I "path_to_key_file" to your command-line, what are the results?

SFXCL /Q /Log 'D:\Log20151005150316.log' /I "path_to_key_file" /P 'passphrase' \\bob\file.txt SFTP://user@bob.com:/RepUpload


By the way, what version of SecureFX are you using?

Please note that if it is SecureFX v7.3.3 or later, we added this functionality:

Changes in SecureFX 7.3.3 (Official) -- March 31, 2015
------------------------------------------------------

New features:

  • Previous versions of SecureFX supported saving passwords and other sensitive data. In order to improve the security of this feature, SecureFX now requires a passphrase to be created the first time version 7.3.3 runs. This passphrase will be used to encrypt and decrypt sensitive data stored in the session database.
Are you sure the prompt is not for the *config passphrase*?

SFXCL cannot work if a config passphrase is set.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 10-06-2015, 09:23 AM
Bob Bob is offline
Registered User
 
Join Date: Oct 2015
Posts: 5
I've remove the config passphrase but he still prompt me to enter the passphrase. But if I have the application open with the connection open, he dont prompt me for the passphrase.

I've the latest version of SecureFX. I try to do a transfert via a powershell on windows.
Reply With Quote
  #4  
Old 10-06-2015, 09:28 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi Bob,

It's very important that *all instances* of SecureFX and SFXCL be closed prior to attempting removal of the config passphrase. Did you verify all instances of both applications were closed?
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 10-06-2015, 09:39 AM
Bob Bob is offline
Registered User
 
Join Date: Oct 2015
Posts: 5
Ok.

I've made a little try. I've copy the line in the DOS command prompt and it work well. Then I must deduct it's the way I call it in powershell.

I build each argument in variable and call it. Like this :

[string]$CMD = 'SFXCL'
[string]$arg1 = '/Q'
[string]$arg2 = '/Log ' + $CheminLog + '\Log' + $(get-date -f yyyyMMddHHmmss) + '.log'
[string]$arg3 = '/I ' + $CheminClePrive
[string]$arg4 = '/P ''' + $Passphrase + ''''
[string]$arg5 = '/F ' + $CheminConfigSecureFX
[string]$arg6 = '\\' + $Serveur + $CheminFichier + $fichier
[string]$arg7 = 'SFTP://' + $UserCCD + '@' + $HostaddressCCD + ':/' + $RepertoireCCD

# The call
& $CMD $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7

How can I call it to work ?
Reply With Quote
  #6  
Old 10-06-2015, 10:10 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Sorry, Bob, I am not a PowerShell expert.

I can tell you this SFXCL syntax is valid, but you already know that from your Windows command shell test:

Code:
SFXCL /Q /Log "some log file path" /I "path to key file" /P "passphrase" /F "path to alternate config" \\fileserver\sourcefile.txt sftp://user@host:/someremotedirectory

It's likely you could have missed escaping some special character.

Are you getting an error?

If so, what is it?

Troubleshooting PowerShell is outside the scope of SecureFX support, but if you post it, maybe the user community can help.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #7  
Old 10-06-2015, 11:27 AM
Bob Bob is offline
Registered User
 
Join Date: Oct 2015
Posts: 5
In fact, I have two type of message :

Invalid argument specified for command line option '/Log D:\Log20151006132248.log'.

And if I remove the log parameter, I have this error :

Copying local files is not supported.

I will try some other way to launch SecureFx

Thanks
Reply With Quote
  #8  
Old 10-06-2015, 11:46 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi Bob,

I think you have forgotten leading (or trailing) spaces when assigning the info to variables.

In my tests, I did get errors if the assigned variable started with '/Option', because when you run the PowerShell statement:

Code:
# The call
& $CMD $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7
The spaces between the args are not literal.

So each variable assignment will likely need a leading or trailing space to separate the SFXCL options:

Code:
[string]$CMD = 'SFXCL'
[string]$arg1 = ' /Q'
[string]$arg2 = ' /Log ' + $CheminLog + '\Log' + $(get-date -f yyyyMMddHHmmss) + '.log'
[string]$arg3 = ' /I ' + $CheminClePrive
[string]$arg4 = ' /P ''' + $Passphrase + ''''
[string]$arg5 = ' /F ' + $CheminConfigSecureFX
[string]$arg6 = ' \\' + $Serveur + $CheminFichier + $fichier
[string]$arg7 = ' SFTP://' + $UserCCD + '@' + $HostaddressCCD + ':/' + $RepertoireCCD
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #9  
Old 10-06-2015, 12:06 PM
Bob Bob is offline
Registered User
 
Join Date: Oct 2015
Posts: 5
I've change the way I call it and it work.

In place of

"& $CMD $arg1 $arg2 $arg3 $arg4 $arg5 $arg6 $arg7"

I proceed like this

"cmd.exe /c "$CMD $argTotal"

where $argTotal is the total of each $arg (1...7).

Not the best but it work for me.
Reply With Quote
  #10  
Old 10-06-2015, 01:07 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi Bob,

Great, I am glad to hear you found a workaround. Thanks for posting an update!
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

Tags
passphrase , scripting

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:14 PM.