cifs mount OK, smbnetfs not

Help
optiluca
2010-09-21
2013-05-28
  • optiluca

    optiluca - 2010-09-21

    Hi. I have salvaged an old laptop running Gentoo and am planning on reconfiguring it as a NAS for my home network. I have successfully configured SAMBA so as to expose two folders to each user on the network, one private, one public. While the server side is working just fine, I would also like to have the NAS mount the User folders from all machines connected on the network, most of which are running Windows 7. For example, for a machine at IP 192.168.0.2 running user "user" and password "pwd" I run the following on the NAS:

    mount //192.168.0.2/Users /mnt/user/ -o username=user,password=pwd

    The "Users" subfolder is due to how windows 7 organises the files it exposes to the network, this folder then contains a public folder and a private one. With the correct username/password I successfully get these two folders under /mnt/user, and all is good.

    However, the machines are coming and going from the network, so in the search of something more flexible I found your sofware, which should automagically mount/unmount network shares as they appear. I have configured the program, started it like so:

    smbnetfs -o allow_other /mnt/samba

    and as expected I get a /mnt/samba/WORKGROUP/ subdirectory. Within this subdirectory are all the machines on the network, including the shares from the NAS itself. I can access these shares under /mnt/samba/WORKGROUP/Gentoo_NAS with no issue whatsoever. However any attempt to enter /mnt/samba/WORKGROUP/WINDOWS_MACHINE gives me the following:

    Code:
    cannot open directory /mnt/samba/WORKGROUP/WINDOWS_MACHINE/: Permission denied

    I know the password file is getting parsed correctly, as under /mnt/samba/WORKGROUP/Gentoo_NAS the folders change according to which username/password I use to login.

    SUMMARY: can't access my windows 7 network shares without manual mounting, despite the same login info being provided!

    I am quite stuck, and would much appreciate an input from someone more knowledgeable than myself :D

    Thanks in advance!

    PS Feel free to ask for logs or whatever may be required

     
  • Mikhail Kshevetskiy

    Hi,

    your wrote

       mount //192.168.0.2/Users /mnt/user/ -o username=user,password=pwd

    works fine, so try with smbnetfs

       cd /mnt/samba/user:pwd@192.168.0.2/Users

    this should work fine also.
    After that you have 2 options:
    1) you have a netbios name resolution problem (WINDOWS_MACHINE can't be resolved to 192.168.0.2)

        try "nmblookup WINDOWS_MACHINE", if you do not get an IP address of that machine -- this is a problem

        possible solutions:
        a) check that you have an "nmbd" daemon running
        b) check firewall settings on linux/windows machines
        c) edit "/etc/hosts" to make static link of ip with netbios name  (add a line like:  "192.168.0.2     WINDOWS_MACHINE")

    2) you forget to add an "auth" entry to ~/.smb/smbnetfs.conf

        add to ~/.smb/smbnetfs.conf

       auth "WINDOWS_MACHINE"    "user"  "pwd"

     
  • optiluca

    optiluca - 2010-09-29

    Hi, thanks for your reply :)   I am afraid that the stumbling block is square 1 for me, here is the output I get:

    Test mount:

    mount //192.168.0.2/Users /mnt/test/ -o username=user,password=pwd

    And all is good, I can access all the folders I am interested in.

    I unmount /mnt/test, and try:

    cd /mnt/samba/user:pwd@192.168.0.2/Users

    , the directory is changed, but.

    Users # ls
    ls: cannot open directory .: Permission denied

    I have tried with deliberately incorrect passwords and I get exactly the same behaviour, so something seems to be wrong in the authentication stage when using smbnetfs…

    In any case, 1 works fine (returns the 192.168.0.2), and 2 I have already done, I have exactly the file as you suggest, and I have also tried using WORKGROUP instead of WINDOWS_MACHINE, with no success.

    Any ideas?? :S

    Thanks again

     
  • Mikhail Kshevetskiy

    Hello,

    i am currently overloaded with a work, so my next answer maybe delayed too. I am sorry about it.

    Do you try "smbclient //192.168.0.2/Users -U user" ? does it works?

    the reason for my question is: smbnetfs and smbclient use the same codebase to work with samba network, so if smbclient works fine, then smbnetfs should also work.

    nevertheless,  think this is the case where i need to look at smbnetfs logs.
    Can you set in your "~/.smb/smbnetfs.conf"

    smbnetfs_debug=6
    log_file="/tmp/smbnetfs.log"

    and try "cd /mnt/samba/user:pwd@192.168.0.2/Users" again?

    also it can be usefull to set "smb_debug_level" to 10 before the test (or make additional test with this setting)

    after that please send me gzipped logs

     
  • optiluca

    optiluca - 2010-10-01

    No worries.  I will not be able to do any testing after Sunday, till christmas, and it is not an urgent issue, so do take your time.  I am grateful you are helping in the first place :)

    Anyway, smbclient also fails with the following message:

    smbclient //192.168.0.2/Users -U user
    Enter user's password:
    session setup failed: SUCCESS - 0

    And debug messages after attempting cd command:

    Debug level 6: http://paste.pocoo.org/show/270022/
    Debug level 10:  http://paste.pocoo.org/show/270025/

    PS Username is luca
    PPS I used pastebin, I hope that is ok.  Where would I have been able to attach a file?  That would have been preferable for security reasons. :S

    Thanks again. :)

     
  • Mikhail Kshevetskiy

    > Where would I have been able to attach a file?

    use my direct mail: mikhail dot kshevetskiy at gmail dot com
    smbnetfs will never show passwords from config file. Unfortunately it part of a path in your case.
    I forget to say you about replacing password by something before sending mail :-(

    i just look to your logs and noticed 3 thins

    1) srv(25813)->smb_conn_srv_auth_fn: url=smb://S2/IPC$, grp=WORKGROUP, user=root, passwd=********

       This means your default login is "root" (not luka) and default password most probably empty.
       I think you do not set valid auth values in (PAY ATTENTION) "/root/.smb/smbnetfs.conf".

    2) 25805->function_stat: (/luca:***@192.168.0.2/Users/app-text_-_wgetpaste-2.18)
         25805->function_stat: (/luca:***@192.168.0.2/Users/[app-text)
         25805->function_stat: (/luca:***@192.168.0.2/Users/wgetpaste-2.18.tar.bz2)

         looks like "cd /mnt/samba/user:pwd@192.168.0.2/Users" works fine

    3) smbnetfs has 2 different debug parameters "smbnetfs_debug" and "smb_debug_level"
        First of them turm of logs of smbnetfs application, the second turns on logs of libsmbclient (e.g logs of network connections).

        you send me a logs with "smbnetfs_debug" only set, but i was asking for
       a) smbnetfs_debug=6, smb_debug_level=0
       b) smbnetfs_debug=6, smb_debug_level=10

       it maybe even better to run smbnetfs from the terminal with the following command
      
        smbnetfs -d -o smbnetfs_debug=6,smb_debug_level=10 mountpoint | tee logfile

    Up to now, the problem is not clear

    Mikhail

     
  • optiluca

    optiluca - 2010-10-01

    Ooops.  Apologies.  I have emailed you the log file using smbnetfs_debug=6, smb_debug_level=10

    I am currently launching smbnetfs in a boot script, which is being run as root.

    Anyway I have also launced it as you suggested, performed the cd, and had the same behaviour.  I also attach that logfile.

    Thanks again :)

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks