Window smb > NAS which need credentials

Get help for specific problems
Posts: 29
Joined: 13 Aug 2019

Louiscar

Hi I have just donated to this and it's an ideal program for me to replace Speedcommander which is not so automated or full featured for syncing as this.

I have a small problem though in that I do not save my credentials for my NAS drive. Therefore they have to be typed in to access the folders via SMB.

Speedcommander didn't have a problem with this, as soon as I attempted to access the NAS the credential popup would appear.

With Freefilesync unfortunately it just tells me that it can't find the folder / location. The only way I am able to get the backup done is if I browse the destination, find the folder / location and attempt to open it, then I will get the popup and FFS can do the backup/s after that till the next reboot or reset the connection.

For reasons I will not go into here I do not want to save credentials in Windows so it would be good if you could see if you can get the same behavior as Speedcommander in forcing the popup to come up without having to go through the hoops.

Unfortunately one thought, to access the NAS via windows explorer and signin to any folder doesn't work, and I did notice this is the same with SC - if I've signed in via Windows Explorer , I still have to sign in again via that.

Other than this the program is simply amazing and just what I've needed for years and didn't realise existed so thanks Zenju.
Posts: 12
Joined: 5 Apr 2019

AlexD

I do the same thing with our File Server which is Server 2016, I am using a Synology NAS which is compatible with Windows Domain Services. I only had to Navigate to the NAS via explorer once and then typed in the correct Credentials to gain access. After this Windows Automatically remembers credentials.

After this i just setup a Batch sync that is triggered via Windows Task Scheduler.
User avatar
Site Admin
Posts: 7205
Joined: 9 Dec 2007

Zenju

What error message do you get (including error code)? FreeFileSync should prompt for credentials, too, if needed!
Posts: 29
Joined: 13 Aug 2019

Louiscar

What error message do you get (including error code)? FreeFileSync should prompt for credentials, too, if needed! Zenju, 17 Aug 2019, 18:33
Thanks for getting back to me:

This is the complete error:
Cannot find the following folders:

\\Nas253\wd_4tb\!!Photos
___________________________________________

Cannot read file attributes of "\\Nas253\wd_4tb".
Error Code 67: The network name cannot be found. [FindFirstFile]
@AlexD Unfortunately as I mentioned, in my case (Windows 7), Speedcommander or FFS can only access the NAS if it signed in via it's shell. I don't quite understand why frankly as after I enter my credentials via Windows explorer I did expect it would be fine. It seems that windows differentiates between shell instances, maybe there is a policy somewhere that allows a single credential to be globally valid.

Either way Accessing via Speedcommander will request credentials and FFS will give me the above message.
User avatar
Site Admin
Posts: 7205
Joined: 9 Dec 2007

Zenju

Can you send me a Process Monitor trace file for the time when you start comparison until the error message occurs?
FreeFileSync currently only prompts for network share credentials when it's sure the share is password protected and not yet logged-in, and FFS tries to err on not showing a prompt when in doubt, rather than show a prompt when it doesn't make sense, e.g. for a non-protected unreachable network share.
if it signed in via it's shell
Strange. I would expect folder access to work for all applications after you've signed in via Explorer and login credentials to be stored at least for the duration of the whole Windows user session.
Posts: 29
Joined: 13 Aug 2019

Louiscar

if it signed in via it's shell
Strange. I would expect folder access to work for all applications after you've signed in via Explorer and login credentials to be stored at least for the duration of the whole Windows user session. Zenju, 18 Aug 2019, 08:33
Well I tested this out in another way. As I can't seem to find anything on Google about how this works, I asked myself about a cmd line and sure enough I try in admin cmd line window:
dir \\nas253\folder
and I get "access denied" and this is after having put the credentials in and explorer window.
So in order to get access within the command line I then have to do:
net use \\nas253\folder /user:admin password
Then I can access it within the cmd window.
I thought maybe that in FFS I could put a batch file with this in and run it but I can't it just sends it to an explorer window.

ok I'll now sort out what you asked for and post the process monitor file when I've done it.

cheers
Posts: 29
Joined: 13 Aug 2019

Louiscar

It took a while to figure out how to get just the ffs activity - the file was too big :-)

Ok I've attached the PML.
Let me know if it's ok.

L
Attachments
louisebay2_ffs_donation.zip
(36.67 KiB) Downloaded 146 times
Posts: 29
Joined: 13 Aug 2019

Louiscar

Well I've found a kind of workaround to this - it still involved jumping through hoops but I found that the cmd line "net use" method does work if it's run as administrator. (btw I do run FFS as admin but it doesn't help this situation)

So in my saved folder I created the following:
Credentials.zip - encripted batch file containing the net use line
... now the hoops to run it properly ..
launchcred.bat - will fire up the zip file into winzip (but batch can't run as admin ...so)
launchcred - shortcut (set to run as admin)
I save the folder it's in as a FFS job so that it shows the folder. I then can run the shortcut which opens the zip file which will also require a password to run the batch file within but then now FFS will be able to access the NAS until I stop and restart lanmanworkstation. But this way my credentials are encrypted 256 and not left in some text file for malicious programs to run.

It's still messy but it's better than picking the job in hand and then having to navigate to the specific folder which you have to find as the start point will be default home drive.

What would be good is to have some kind of inclusion for credentials held within FFS and obviously the error would have to be fixed to accept the password request like Speedcommander does. Of course the credentials would best be encrypted but even if not it's less likely that a malicious program will find it.

I will use this at least to make life easier till maybe there is a better solution or you figure out if how to get the credential dialogue to pop up. (That'd be easiest for all I think)
User avatar
Site Admin
Posts: 7205
Joined: 9 Dec 2007

Zenju

Well I tested this out in another way. As I can't seem to find anything on Google about how this works, I asked myself about a cmd line and sure enough I try in admin cmd line window:
dir \\nas253\folder
and I get "access denied" and this is after having put the credentials in and explorer window.Louiscar, 18 Aug 2019, 08:55
This can be explained by the fact that Windows Explorer was not running as admin when you logged into your NAS. Therefore your login info was in fact buffered, but only for other non-elevated (=non-admin) processes. Windows treats elevated processes as a different user session.

It took a while to figure out how to get just the ffs activity - the file was too big :-)

Ok I've attached the PML.
Let me know if it's ok. Louiscar, 18 Aug 2019, 09:46
A bit small, but useful. It seems all the info FFS has is "access denied", which is a little weak. I'm wondering what Speedcommander is checking. Can you send me a Process Monitor trace for the time when Speedcommander shows the login prompt for your NAS?


And here's a little test, just as a proof of concept: FFS checking for "access denied" and showing the prompt: https://www.mediafire.com/file/r4c6bzkr5rnemli/FreeFileSync_10.16_%5BBeta%5D_Windows_Setup.exe
Posts: 29
Joined: 13 Aug 2019

Louiscar

Well I tested this out in another way. As I can't seem to find anything on Google about how this works, I asked myself about a cmd line and sure enough I try in admin cmd line window:
dir \\nas253\folder
and I get "access denied" and this is after having put the credentials in and explorer window.Louiscar, 18 Aug 2019, 08:55
This can be explained by the fact that Windows Explorer was not running as admin when you logged into your NAS. Therefore your login info was in fact buffered, but only for other non-elevated (=non-admin) processes. Windows treats elevated processes as a different user session. Zenju, 21 Aug 2019, 13:55
I am running as administrator so explorer is running as admin. But still the CMD as admin is still causing a separate buffer to be created.

Let me know if it's ok. Louiscar, 18 Aug 2019, 09:46
A bit small, but useful. Zenju, 21 Aug 2019, 13:55
All I did was to isolate the FFS threads since anything else was too big to be uploaded. I don't know what the limit is but even 1MB was not accepted. I didn't see anything in the instructions that said how to get just the information you wanted so I was ending up with quite a large file.

Even doing the Speedcommander on it's own creates something to large (1.3MB) to be uploaded and this was :
1) load Speedcommander
2) Try to access the NAS
3) Exit and save PM file

It seems all the info FFS has is "access denied", which is a little weak. I'm wondering what Speedcommander is checking. Can you send me a Process Monitor trace for the time when Speedcommander shows the login prompt for your NAS?


And here's a little test, just as a proof of concept: FFS checking for "access denied" and showing the prompt: https://www.mediafire.com/file/r4c6bzkr5rnemli/FreeFileSync_10.16_%5BBeta%5D_Windows_Setup.exe Zenju, 21 Aug 2019, 13:55
Yes well that works well :-)

I'm uploading Speedcommander PML however as mentioned above I had to limit the trace to begin after it was started and:

1) Refresh the NAS Shares
2) Try to access one of the folders.
3) Exit and save.
So at 3) this is when the dialogue box has been displayed and waiting input.
Attachments
speedcomnmander.zip
(74.86 KiB) Downloaded 129 times
User avatar
Site Admin
Posts: 7205
Joined: 9 Dec 2007

Zenju

I am running as administrator so explorer is running as admin. Louiscar, 22 Aug 2019, 00:56
That's no longer the case since Windows Vista and later: Explorer is running non-elevated, unless you explicitly kill the process and restart from a parent process, that is also elevated. Admin accounts now behave the same as user accounts except for the possibililty of process elevation.

All I did was to isolate the FFS threads since anything else was too big to be uploaded. Louiscar, 22 Aug 2019, 00:56
The link did not explain that the pml file can be compressed and uploaded to some file hoster: Fixed.

Yes well that works well :-) Louiscar, 22 Aug 2019, 00:56
Great, so all that's left is a little fine-tuning, hopefully.

I had to limit the trace to begin after it was started and: Louiscar, 22 Aug 2019, 00:56
Looks good enough. I'm only interested in the first NAS access.
Posts: 29
Joined: 13 Aug 2019

Louiscar

I am running as administrator..... Louiscar, 22 Aug 2019, 00:56
That's no longer the case since Windows Vista and later: Explorer is running non-elevated, unless you explicitly kill the process and restart from a parent process, that is also elevated...... Zenju, 22 Aug 2019, 12:24
Ok that makes sense then.
All I did was to isolate the FFS threads since anything else was too big to be uploaded. Louiscar, 22 Aug 2019, 00:56
The link did not explain that the pml file can be compressed and uploaded to some file hoster: Fixed. Zenju, 22 Aug 2019, 12:24
Ok I'll remember that for the future, I hadn't realised.
Yes well that works well :-) Louiscar, 22 Aug 2019, 00:56
Great, so all that's left is a little fine-tuning, hopefully. Zenju, 22 Aug 2019, 12:24
That's fantastic - this will definitely make life easier. Thank you!