Tomasz Kobiela - Amazis.net
2009-Sep-17 12:58 UTC
[Samba] Question about command line tools.
Hello. I have searched net for this information and I could find solution for my problems. I'm writing a perl script which searches local network for computers with windows shares. I have done this by executing nmblookup -M -- - From this command I get a list of computer (by ip) with MSBROWSE. Then I'm using smbclient command to get shares from every ip. I have one problem to solve. How I can check if share needs password and user ? Which command tool use to examine if shares need authentication. Now I use mount option with user=% it works for servers without password. If mount is not successful I read error and prompt for password. But this is ugly solution. I have one server which can be mounted with user=% but mounted shares are avaliable only for root user. If I mount it with user and password everything works. Maybe this is silly question but I can't find command tool for checking if password is needed. Thank in advance. -- Pozdrawiam/Kind regards Tomasz Kobiela
> Then I'm using smbclient command to get shares from every ip. > I have one problem to solve. > How I can check if share needs password and user ?Can you use "smbclient -N" to log in anonymously and check for success? If it fails it means you'll need a password. Bear in mind that servers can return different shares depending on who you connect as. Cheers, Adam.