Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, Please, i need help with security mode = share. i want to configure security = share and the parameter "username = user" in a shared folder to avoid that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225

    security share samba


    Hello,
    Please, i need help with security mode = share.
    i want to configure security = share and the parameter "username = user" in a shared folder to avoid that everybody could access to it. f I have understood correctly the manual, this configuration enables to access if the password provided matches with the user`password. But when i try to access returns this error:
    smbclient //SERVER/Docs
    Enter user's password:
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.7]
    Server not using user level security and no password supplied.
    tree connect failed: NT_STATUS_WRONG_PASSWORD

    I also tried:
    smbclient -U user%passwd //SERVER/Docs
    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.7]
    Server not using user level security and no password supplied.
    tree connect failed: NT_STATUS_WRONG_PASSWORD

    smbclient -U user%passwd //SERVER/Docs -P
    Failed to open /var/lib/samba/secrets.tdb
    ERROR: Unable to open secrets database

    sudo smbclient -U user%passwd //SERVER/Docs -P
    ERROR: Unable to fetch machine password for SERVER$@ in domain WORKGROUP

    If i change "passdb backend = smbpasswd" in GLOBAL options:

    smbclient -U user%passwd //SERVER/Docs -P -e -A /etc/samba/smbpasswd
    ERROR: Unable to open credentials file!

    sudo smbclient -U user%passwd //SERVER/Docs -P -e -A /etc/samba/smbpasswd
    ERROR: Unable to fetch machine password for SERVER$@ in domain WORKGROUP

    My config:

    testparm

    Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.4.7]
    smb: \> quit
    jose@jose-laptop:~$ testparm
    Load smb config files from /etc/samba/smb.conf
    rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
    Processing section "[printers]"
    Processing section "[print$]"
    Processing section "[Docs]"
    Processing section "[printers]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    Press enter to see a dump of your service definitions

    [global]
    netbios name = SERVER
    server string = %h server (Samba, Ubuntu)
    map to guest = Bad User
    client lanman auth = Yes
    security = SHARE
    obey pam restrictions = Yes
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    unix password sync = Yes
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    dns proxy = No
    usershare allow guests = Yes
    panic action = /usr/share/samba/panic-action %d

    [printers]
    comment = All Printers
    path = /var/spool/samba
    create mask = 0700
    printable = Yes
    browseable = No
    browsable = No

    [print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers

    [Docs]
    comment = Documents
    path = /home/user/Documentos/Docs
    read only = No
    username = user

    smbtree

    WORKGROUP
    \\SERVER server (Samba, Ubuntu)
    \\SERVER\IPC$ IPC Service (server (Samba, Ubuntu))
    \\SERVER\Docs Documents
    \\SERVER\print$ Printer Drivers

    sudo pdbedit -Lw
    nobody:65534:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:
    user:1000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:CC63D87 C86C99FF2FB25B31C84CF584A:[U ]:LCT-4C23B25F:
    smbguest:1001:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:

    Thanks in advance for your time
    Regards

  2. #2
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    if you are going to use smbpasswd you should try the following:

    did you create a user on the samba server using:
    Code:
    smbpasswd -a username
    if you did check the permissions on the file /etc/samba/smbpasswd
    linux user # 503963

  3. #3
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225
    hello,
    thanks for your help.

    I did all these things but it fails. Only run if i set "guest only = ok" or "guest ok = yes"

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    what about if you use the default security method of user instead of using share?

    is there anything in /etc/samba/smbpasswd?
    linux user # 503963

  6. #5
    Linux Newbie JosePF's Avatar
    Join Date
    Jun 2010
    Posts
    225
    Hi,
    I would like to use Share security because names of windows users are not the same that the Linux users.

    cat /etc/samba/smbpasswd
    #
    # SMB password file.
    #
    nobody:65534:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:nobody
    user:1000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:user
    smbguest:1001:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:Samba guest account

    I had tried too with "username map = /etc/samba/users" and nothing

    I have no idea what I'm doing wrong or if i have not understood something

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •