[Samba] (again) - problem with users

Discussion in 'Windows Desktop Systems' started by Glaanieboy, May 24, 2004.

  1. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Yesterday I reinstalled my server, because of some hardware issues. Among the programs I reinstalled is Samba. I successfully configured Samba the last time, it let me use a network share with no problems. But now when I want to open a share on my server, it asks me to type in a username/password combination, while the username and password on both the FreeBSD box and my Windows XP box are the same. When I type in the username and password, it gives the error as you can see in the attached file. I went to the log.<windows_box_name> file, and there I saw the following error, each time I tried logging in:
    Code:
    [2004/05/24 20:35:50, 0] smbd/password.c:authorise_login(863)
      authorise_login: rejected invalid user nobody
    I don't understand why it's trying to authorise user nobody, while I type in the username of glenn.
    Of course I first did 'smbpasswd -a glenn' to make the user in the Samba environment (with the same password as my Windows box).
    security has been set to user and password encryption has been set on yes.

    I am lost, maybe someone can help me?
     

    Attached Files:

  2. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    DOH! Edited the post with attached image. :rolleyes:
     
  3. cpugeniusmv

    cpugeniusmv Computer Genius

    Messages:
    485
    do you want the share to be password protected, or open to anyone?

    post your smb.conf file.
     
  4. canadian_divx

    canadian_divx Canadian_divx

    i am having this same error with a fedora server i am working on. it is set to share to everyone but my windows still wont see it
     
  5. cpugeniusmv

    cpugeniusmv Computer Genius

    Messages:
    485
    post your smb.conf too :D
     
  6. cpugeniusmv

    cpugeniusmv Computer Genius

    Messages:
    485
    make sure that the user you're trying to connect with (nobody for anonymous logins) has permission to get into and/or read/write files in it. couldn't hurt to change the ownership to nobody:nogroup if you just want a "everyone can read/write" share.
     
  7. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    hmm seems like you omitted the smbpasswd line in smb.conf so it doesn't know how to authenticate, did you add

    smb passwd file = /etc/smbpasswd

    Here's a generic smb.conf that should work:

    Code:
    [global]
    workgroup = your workgroup
    server string = pc description
    netbios name = machine name
    log file = /var/log/log.%m
    max log size = 50
    security = user
    smb passwd file = /etc/smbpasswd
    encrypt passwords = yes
    socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
    dns_proxy = no
    
    [sharename]
    path = /the/path/to/your/share
    public = no
    writeable = yes ##only if you want to be able to write to the directory ##
    valid users = user1 user2 ##only necessary if you want to restrict users ##
     
  8. cpugeniusmv

    cpugeniusmv Computer Genius

    Messages:
    485
    you can also do testparm -v /etc/samba/smb.conf to see the (default) values that have been set that are not visible in your smb.conf.
     
  9. canadian_divx

    canadian_divx Canadian_divx

    here is my SMB.conf

    it is an attachment becuase it is kinda large because of 9 hdds and other fedora stuff

    ======================== Share Definitions ==============================
    idmap uid = 16777216-33554431
    idmap gid = 16777216-33554431
    template shell = /bin/false
    password server = None
    security = SHARE
    encrypt passwords = no
    guest ok = yes
    guest account = steve
    winbind use default domain = no
    [homes]
    comment = Home Directories
    browseable = no
    writeable = yes

    # Un-comment the following and create the netlogon directory for Domain Logons
    ; [netlogon]
    ; comment = Network Logon Service
    ; path = /home/netlogon
    ; guest ok = yes
    ; writable = no
    ; share modes = no


    # Un-comment the following to provide a specific roving profile share
    # the default is to use the user's home directory
    ;[Profiles]
    ; path = /home/profiles
    ; browseable = no
    ; guest ok = yes


    # NOTE: If you have a BSD-style print system there is no need to
    # specifically define each individual printer
    [printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = no
    # Set public = yes to allow user 'guest account' to print
    printable = yes

    # This one is useful for people to share files
    ;[tmp]
    ; comment = Temporary file space
    ; path = /tmp
    ; read only = no
    ; public = yes

    # A publicly accessible directory, but read only, except for people in
    # the "staff" group
    ;[public]
    ; comment = Public Stuff
    ; path = /home/samba
    ; public = yes
    ; read only = yes
    ; write list = @staff

    # Other examples.
    #
    # A private printer, usable only by fred. Spool data will be placed in fred's
    # home directory. Note that fred must have write access to the spool directory,
    # wherever it is.
    ;[fredsprn]
    ; comment = Fred's Printer
    ; valid users = fred
    ; path = /homes/fred
    ; printer = freds_printer
    ; public = no
    ; writable = no
    ; printable = yes

    # A private directory, usable only by fred. Note that fred requires write
    # access to the directory.
    ;[fredsdir]
    ; comment = Fred's Service
    ; path = /usr/somewhere/private
    ; valid users = fred
    ; public = no
    ; writable = yes
    ; printable = no

    # a service which has a different directory for each machine that connects
    # this allows you to tailor configurations to incoming machines. You could
    # also use the %u option to tailor it by user name.
    # The %m gets replaced with the machine name that is connecting.
    ;[pchome]
    ; comment = PC Directories
    ; path = /usr/pc/%m
    ; public = no
    ; writable = yes

    # A publicly accessible directory, read/write to all users. Note that all files
    # created in the directory by users will be owned by the default user, so
    # any user with access can delete any other user's files. Obviously this
    # directory must be writable by the default user. Another user could of course
    # be specified, in which case all files would be owned by that user instead.
    ;[public]
    ; path = /usr/somewhere/else/public
    ; public = yes
    ; only guest = yes
    ; writable = yes
    ; printable = no

    # The following two entries demonstrate how to share a directory so that two
    # users can place files there that will be owned by the specific users. In this
    # setup, the directory should be writable by both users and should have the
    # sticky bit set on it to prevent abuse. Obviously this could be extended to
    # as many users as required.
    ;[myshare]
    ; comment = Mary's and Fred's stuff
    ; path = /usr/somewhere/shared
    ; valid users = mary fred
    ; public = no
    ; writable = yes
    ; printable = no
    ; create mask = 0765


    [storage_1]
    comment = Storage 1
    path = /storage_1
    writeable = yes
    guest ok = yes

    [storage_2]
    path = /storage_2
    writeable = yes
    comment = storage 2
    guest ok = yes

    [storage_3]
    comment = storage 3
    path = /storage_3
    writeable = yes
    guest ok = yes

    [storage_4]
    comment = storage 4
    path = /storage_4
    writeable = yes
    guest ok = yes

    [storage_5]
    comment = storage 5
    path = /storage_5
    writeable = yes
    guest ok = yes

    [storage_6]
    comment = storage 6
    path = /storage_6
    writeable = yes
    guest ok = yes

    [storage_7]
    comment = storage 7
    path = /storage_7
    writeable = yes
    guest ok = yes

    [storage_8]
    comment = storage 8
    path = /storage_8
    writeable = yes
    guest ok = yes

    [storage_9]
    comment = storage 9
    path = /storage_9
    writeable = yes
    guest ok = yes
     
  10. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    OK, I added the smb passwd line (which I pointed to /usr/local/bin/smbpasswd, since it resides there, there is nothing in /etc), but when adding users, I am getting this error:
    Code:
    server1# smbpasswd -a glenn
    New SMB password:
    Retype new SMB password:
    unable to open passdb database.
    Added user glenn.
    
    But it seems it did add the user, but for some reason it can't find the passdb file. Is this where the Unix passwords are stored? Anyway, this trick didn't work, since Windows is giving the same error.

    edit: added the smb.conf file as an attachment.
     

    Attached Files:

  11. canadian_divx

    canadian_divx Canadian_divx

    i can now viwe the share and view teh files in it but i do not have teh rights to write to it.
     
  12. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Try adding 'read only = no' to each network share. That's what I remember from the previous time I installed Samba.
     
  13. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    /usr/local/bin/smbpasswd is the executable not the password file, it should create the smbpasswd file in /etc; I checked and it is there on FreeBSD. You should have both a passwd and smbpasswd in /etc

    Code:
    joe@daemonode$ ls | grep passwd
    master.passwd
    master.passwd.bak
    passwd
    smbpasswd
    joe@daemonode$
     
  14. canadian_divx

    canadian_divx Canadian_divx

    i added the line but still no go. any other ideas?

    what about guest account = steve could i replase the name with annonumus (spelling)
     
  15. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    Changed the value for smb passwd, but still nothing. Can you take a look at my smb.conf file and tell me if anything is wrong?
     
  16. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    smb passwd file = /usr/local/etc/smbpasswd

    ^ that is what you have listed, but it should be in just plain /etc, atleast it is here on both linux and freebsd
     
  17. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    That's what I forgot to tell, the file I uploaded still points to the faulty location. I already edited it, so that's ok :) Couldn't you find anymore errors?
     
  18. cpugeniusmv

    cpugeniusmv Computer Genius

    Messages:
    485
    do a whereis smbpasswd and use the one that's not in /usr/local/bin
     
  19. Glaanieboy

    Glaanieboy Moderator

    Messages:
    2,626
    Location:
    The Netherlands
    I know that (/etc/smbpasswd) ;) :p :)
     
  20. j79zlr

    j79zlr Glaanies script monkey Political User

    Messages:
    2,725
    Location:
    Chicago
    Everything else looked ok