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?



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

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

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

I can also unmount the shared folder with

$ sudo umount

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