We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

Can't detect the samba share.[Resolved]



  • follow the steps: https://wiki.onion.io/Tutorials/Sharing-with-Samba
    I still can't setup samba server.
    The share folders can't detected by Win10, ubuntu, and other OS.
    Does anyone can help? Thank you.

    HW: OMEGA2+

    root@Omega-516B:/# ps |grep smb
    1154 root 2428 S /usr/sbin/smbd -F

    root@Omega-516B:/# ps |grep nmb
    1155 root 2204 S /usr/sbin/nmbd -F



  • Same problem on OMEGA2, latest firmware (0.1.9 b149).
    Did you try to edit the 'security' field to 'share' in /etc/samba/smb.config.template ?

    in my case, the problem persists anyway.

    EDIT:
    Switched to the official LEDE repo and 'fresh' (with new config files) installed the samba36-server package: Still the smb server is not detectable. I've also tried to follow this tutorial

    EDIT2:
    tried to open samba typical ports adding rules to /etc/config/firewall and tried to add mi router to /etc/hosts. Samba is still not detectable my mac and phone.

    EDIT3:
    RESOLVED => It seems like the samba package and the firmware don't communicate very well: basically samba doesn't know which network interface is available. I fixed by specifying it in the general samba settings, use:

    uci set samba.@samba[0].interface='eth* [YOUR_CLIENT_IP]/[SUB_NET_MASK]'
    uci commit samba
    /etc/init.d/samba restart

    this will allow samba to acces every eth* network interface, the other two field should be optional, only there to allow a specific IP/mask (my mac in my shared wifi, later i'll put a password)

    Read here for more info.

    EDIT4:
    I checked and 'everything' is working right now. I think that the problem is the strange name the wireless interface has (eth0.1), or at least I'm used to integer numbers.



  • I am getting the same thing using the same setup as in the tutorial.

    I changed a few things (not allowing guest) and created my samba user/pass using smbpasswd, and still not able to connect.

    Tried using IP and Name (yes, bonjour installed and I can connect via name with FTP and SSL).



  • Mark as [RESOLVED] please.



  • @Enrico-Trevisanello As for marking resolved, use the vertical ellipses on the first post and edit the title.

    Just realized you were not OP.



  • @Brad-Buskey I guess he would if he was the OP.



  • @Costas-Costas Just saw that...



  • @Enrico-Trevisanello I attempted to use the code you posted, and am getting an error.

    uci set samba.@samba[0].interface='eth* 192.168.1.100/255.255.255.0'
    "uci: Parse error (invalid command) at line 3, byte 1"



  • @Brad-Buskey oh sorry, I'm a beginner too and I don't know what's not working there. Actually, I edited the file /etc/config/samba directly using 'vi', this is how its general section looks like now:
    0_1486107516027_Screen Shot 2017-02-03 at 08.37.59.png



  • @Enrico-Trevisanello Sweet! That worked like a charm. showed up immediately after restarting the service.

    However, while I can view, I cannot actually enter the directory. It will not accept my userid/password.



  • Am I not able to connect as 'root'? Do I need to create a new user account in order to allow access?



  • as i remember from playing around with samba, that you can grant the rights for root in the configuration. Just might be a security issue?!



  • Thank you @Enrico Trevisanello!

    The following worked for me:
    uci set samba.@samba[0].interface='eth* [YOUR_CLIENT_IP]/[SUB_NET_MASK]'
    uci commit samba
    /etc/init.d/samba restart

    I'm currently on 0.1.9 b150 firmware if that helps.



  • @Brad-Buskey yes! you have to! check (and modify) the the file /etc/samba/smb.conf.template
    this file is the template, as the name says itself, and is used to generate the actual config file /etc/samba/smb.conf every time the samba service starts (so also when you restart it).



  • @Enrico-Trevisanello Thank you. It works. I edited the /etc/config/samba directly. added the interface.



  • FYI: You can set '*' for the interfaces value, that way it will work for BOTH ethernet and wlan.

    I also created a /shared directory and an smb user to manage all the samba files. This is what I have now:

    root@Omega-72FF:~# cat /etc/config/samba
    config samba
        option 'name'                   'Omega'
        option 'workgroup'              'WORKGROUP'
        option 'description'            'Omega'
        option 'homes'                  '0'
        option 'interface'              '*' # <-- (wlan + ethernet)
    
    config 'sambashare'
        option 'name'           'shared'
        option 'path'           '/shared'
        option 'users'          'smb'
        option 'guest_ok'       'yes'
        option 'create_mask'    '0700'
        option 'dir_mask'       '0700'
        option 'read_only'      'no'
    

    Note that the smb user has to be created both as a system user AND samba user. This is done by editing the /etc/passwd file (add a line), setting the password for the newly created use (passwd smb) and creating the user at samba level with smbpasswd -a smb. Make sure you also do chown smb /shared so that this user owns the relevant directory.

    As per @Luciano-S coment above, the reason for going through all this malarchy is because the root user by default is prevented from being a samba user as well (I'm guessing because of the security risk).

    You can probably turn this off by commenting the relevant line in /etc/samba/smb.conf.template then setting root as your sambashare user instead.. but I was happier with the config above:

    [global]
        netbios name = |NAME|
        display charset = |CHARSET|
        interfaces = |INTERFACES|
        server string = |DESCRIPTION|
        unix charset = |CHARSET|
        workgroup = |WORKGROUP|
        local master = no
        browseable = yes
        deadtime = 30
        domain master = yes
        encrypt passwords = yes
        enable core files = no
        guest ok = yes
    #   invalid users = root  # hmmm.. is commenting this out a good idea?
        load printers = no
        map to guest = Bad User
        max protocol = SMB2


  • @Steven-de-Salas What is the line syntax for the new user in /etc/passwd

    It looks like User:?:?:?:user?:home-dir:shell
    I dont know the ? in the above?

    I almost have it, I just cant get authenticated.



  • @Brad-Buskey said in Can't detect the samba share.[Resolved]:

    I almost have it, I just cant get authenticated.

    I guess you have to tell us witch way you took. If you gave the user root full access you may not have to authenticate?



  • Just to see if I can get into the smb share, I commented out the Invalid User from the template.
    I created the root account in the smbpasswd
    I then attempted to connect to the share (via OSX) and was able to connect to the share.
    This gives me a list of the directories (I mapped it to '/')
    All of the directories, when I attempt to access them, return the following:
    "The folder 'root' can't be opened because you do not have permission to see its contents."

    I used the template above from Steven for the share, commenting out the "option 'users' line.

    Once I get the /etc/passwd worked out, I will go back to using a separate user for the samba, however I have a feeling I will get the same results (no access to any directory) anyway. So I want to get it working with root first.



  • @Brad-Buskey: I used this link to create my new /etc/passwd user, the result is as follows:

    smb:x:501:501:samba:/shared:/bin/ash
    

    My understanding is that this is equivalent to:

    [user]:[pwd]:[id]:[id]:[desc]:[home]:[shell]
    

    When running passwd smb the [pwd] component seems to get replaced by a hash of the password.

    Dont forget you also need to give user full access the the [home] directory. I used chown smb /shared to acomplish this.

    You can also verify samba auth locally before moving on to connect via your desktop:

    $ opkg install samba36-client
    ...(package download blah blah)...
    $ smbclient -L localhost -U smb
    Enter smb's password: ******
    
        Sharename       Type      Comment
        ---------       ----      -------
        shared          Disk
        IPC$            IPC       IPC Service (Omega)
    
        Server               Comment
        ---------            -------
        MEDIAHUB             WD TV Live
        OMEGA                Omega
    
        Workgroup            Master
        ---------            -------
        WORKGROUP            MEDIAHUB

Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.