I'm writing a script to scan Windows shares.

Running the script from Windows, it works fine. But running it from Linux and it doesn't work. I don't get any errors, it just doesn't return anything.

I'm guessing this is probably an authentication issue of some kind. On Windows, it automatically passes my credentials, but on Linux, my credentials are different (my Linux box is not a domain member).

Are there any options to pass a username/password to os.walk?

Thanks.

Jason

In linux, windows shares must be mounted. For example at home, I mount the (shared) C drive of another computer with IP address 192.168.2.4 like this

$ sudo mount -t cifs 192.168.2.4:C -o password="" /mnt/othercomp

I can then access /mnt/othercomp like any other directory.

I can also unmount the shared folder with

$ sudo umount 192.168.2.4:C

Also you can obtain an IP address like this

$ nmblookup computer_name

edit: before invoking 'mount', you must create the directory /mnt/othercomp with mkdir :)

commented: This helped me. Thanks +1