WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
SFTP Certificate Based authentication (Read 816 times)
Zack Baraci
YaBB Newbies
*
Offline



Posts: 7
SFTP Certificate Based authentication
Apr 28th, 2017 at 7:19am
 
Wondering if there is any ETA on the ability to do certificate based authentication from the watch dir FTP plugin?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: SFTP Certificate Based authentication
Reply #1 - Apr 29th, 2017 at 5:51am
 
Hello Zack,

We plan to start work on a major release (version 5) soon. However we foresee this will be a lot of work and do not expect v5 to be released soon, likely late this year or early next year. v5 will implement private key logins for SFTP connections (among a lot of other things).

I believe some of our customers use the "Run any program" task with a command-line SFTP client to upload.

Gert
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Zack Baraci
YaBB Newbies
*
Offline



Posts: 7
Re: SFTP Certificate Based authentication
Reply #2 - May 1st, 2017 at 3:16am
 
I have had a go at this but am not able to get watchdir to work.  A batch file i have works when run by itself.  But when launched from watchdir it does nothing. so i am not sure whats going on there.  I will update watchdir as i need a new version for another issue i have.
Back to top
 
 
IP Logged
 
Zack Baraci
YaBB Newbies
*
Offline



Posts: 7
Re: SFTP Certificate Based authentication
Reply #3 - May 1st, 2017 at 3:26am
 
I tries something like this

pscp.exe -i <keyfile> -sftp "%WD_FILE%" <username@address>:/incoming
move "%WD_FILE%" /backupdir

If i ran this outside of watch dir it would work.  Obviously without the watchdir varables.  But it would just remain stuck on waiting on program and timeout after the timeout period so no idea why its hanging.
Back to top
 
 
IP Logged
 
Zack Baraci
YaBB Newbies
*
Offline



Posts: 7
Re: SFTP Certificate Based authentication
Reply #4 - May 1st, 2017 at 4:30am
 
It triggers the script but nothing from the script at all runs.  It makes no sense to me.

on 4.8.7 version.
Back to top
 

watrchdir_cap.PNG (5 KB | 41 )
watrchdir_cap.PNG
 
IP Logged
 
Zack Baraci
YaBB Newbies
*
Offline



Posts: 7
Re: SFTP Certificate Based authentication
Reply #5 - May 1st, 2017 at 5:54am
 
Ahh interesting.  It seems you can't run this as a service as it will not do anything when run as a service.  If you choose to run manually it works fine.  I chose to run as startup for all users.  The question is will this persist through restart of system or will it need manual startup?
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: SFTP Certificate Based authentication
Reply #6 - May 1st, 2017 at 8:03pm
 
Hello Zack,

Sorry for the late reply.
You may want to read this: http://blog-en.gdpsoftware.com/2010/04/watchdirectory-tasks-as-windows-service.h...

Services have (by default) limited access on the network.

If you "run a batch file" tasks, logs of output are at
"Tools -> Explore Task Directory"
then click the subdirectory with the name of your task.
Make sure your script does not have "ECHO OFF" obviously.
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Zack Baraci
YaBB Newbies
*
Offline



Posts: 7
Re: SFTP Certificate Based authentication
Reply #7 - May 2nd, 2017 at 2:34am
 
Seems nothing happens at all when run as service not even a log file is geneated.  Only works when run normal.  All assets are local on the machine but it simply does not even launch the batch file as service.

Will have to run it as an active task. Sad
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: SFTP Certificate Based authentication
Reply #8 - May 2nd, 2017 at 6:10am
 
Can you rename your script to txt and post it here so I can have a look? Obviously change passwords etc.

A few things....
Never assume a certain working directory in your script. When a task runs as a service, depending on the Windows version, it typically is C:\Windows\System32. When run "normal" I think it is the monitored directory.

Always use full paths to files.

Always enclose filenames in "quotes".
Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Dirk
YaBB Administrator
*****
Offline



Posts: 658
South Germany
Re: SFTP Certificate Based authentication
Reply #9 - May 2nd, 2017 at 8:47am
 
Hi Zack,

make sure that the user the service is running has read/writes rights to all needed folders. Make also sure that he is allowed to log on as service, see here: https://technet.microsoft.com/de-de/library/cc794944(v=ws.10).aspx

Do not place your script or log file direct on the desktop, use a temp foldr with correct rights instead.
Back to top
 

Viele Grüße / Best regards
Dirk - GdP Software

dirk [at] gdpsoftware [dot] com
http://blog-de.gdpsoftware.com
Webseite: http://www.gdpsoftware.com
WWW WWW  
IP Logged
 
Page Index Toggle Pages: 1