0

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

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by Gribouillis
1

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

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.