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?



8 Years
Discussion Span
Last Post by Gribouillis

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 :)

Edited by Gribouillis: n/a

Votes + Comments
This helped me. Thanks
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.