Results 1 to 3 of 3

Thread: Samba: toegang

  1. #1

    Question Samba: toegang

    Hoe kan ik in Samba toegang beperken tot een bepaalde user? Ik heb deze vraag ook in het Engels gesteld op het forum, maar tot nu toe geen reaktie gehad. Het is me wel gelukt via adduser een gebruiker toe te voegen en deze ook met smbpasswd een password toe te kennen. Als ik vervolgens in smb.conf security=share verander in security=user, lukt het inloggen op Samba me vanuit WinXP prof niet meer... Enig idee hoe dit op te lossen is? Bij voorbaat erg veel dank!

  2. #2
    Join Date
    Feb 2005
    Location
    Zeist, Netherlands
    Posts
    47
    Het is wat gevoelig voor de juiste instellingen, maar het moet kunnen.
    Als eerste moeten de XP-pc en de Asus dezelfde werkgroep hanteren.
    Strikt genomen moet dit niet noodzakelijk zijn, maar het vergemakkelijkt
    de eerste pogingen echt enorm. Dan moet er natuurlijk sowieso
    een netwerk-verbinding tussen de twee bestaan, evt. firewall-software
    moet geen belemmeringen opwerpen etc.
    Verder kun je op safe spelen door je Asus preferred en master browser
    te maken, dan hebben je apparaten daar onderling ook geen discussie over.
    (aanpassen in /etc/smb.conf).
    Geef daarnaast in je XP-PC de Asus op als WINS-server, dan heb je voor
    beide typen WindowsNameResolution (broadcast en client/server) de zaken
    op orde.
    Als laatste horde die ik zelf wel eens heb moeten nemen, met Win2K
    en met WinXP, is er een policy die je moet wijzigen. Maar dat begon
    meestal pas te spelen als ik de betreffende WinPC lid van een
    domein maakte, niet zolang hij lid van een werkgroep was.
    Kennelijk een essentieel verschil. De policy betrof het vereisen
    van een encrypted verbinding voor het netwerkverkeer, en deze
    eis moest veranderd worden in een wens. Overigens had de policy
    ook wel de term "Lid van domein:" in zich, dus dat kwam overeen met
    mijn ervaringen...

    Draai ook op je Asus de smbd- en nmbd-processen met de switch -d 5.
    Dat geeft hopelijk veel log-messages in /var/log/smbd en /var/log/nmbd.
    Die messages kunnen je soms ook net een stapje verder helpen.

    Groet, en succes, Jaap.

  3. #3

    Share per gebruiker

    Informatie komt uit:
    http://www.linuxjournal.com/article/2717

    Dit zijn van toepassing zijnde fragmenten:
    >>
    SMB Password Hashes

    There are two styles of SMB-encrypted-password authentication: LanManager and Windows NT. Both techniques use a file which contains hashed values of a user's password, not plaintext passwords, just as the standard UNIX authentication method does. However, each uses its own technique to generate this hash.
    <<
    Dus met XP (=opvolger Windows NT) ecncrypted passwords!

    >>
    Using Encrypted Passwords in Samba

    Configuring Samba to use encrypted passwords is easy--just include this setting in the global section of your configuration file:

    encrypt passwords = yes

    Encrypted passwords work with all three security levels: share, user and server. Setting the security option to user or share requires that the Samba-encrypted-password file exist. If security is set to server, no further configuration is necessary, since all authentication requests will be passed off to a different SMB server. The server security option provides an easy way to integrate a Samba server into an existing NT domain. However, most installations of Samba will use user- or share-level security. The most common configuration is this:

    security = user
    encrypt passwords = yes

    Both the share and the user modes require the smbpasswd file, which contains the LanManager and NT password hashes for each user who will be accessing the Samba server.

    The Samba-encrypted-password file, smbpasswd, is stored by default in /usr/local/samba/private. This directory is normally owned by root, with its permissions set to 500, so that only root can look at its contents. However, this configuration isn't strictly required--your smbpasswd file can be stored any place you wish. The Samba Red Hat package stores the smbpasswd file in the sensible location of /etc/smbpasswd. Wherever the smbpasswd file is stored, its permissions should be set to 600 (only user read and write) and it must be owned by root. It must not be possible for any user other than root to read this file.

    Users can be added to the smbpasswd file in several ways. The best way is to use the smbpasswd -add command. For example,

    smbpasswd -add jdblair foobar

    will add an entry for jdblair with a password of foobar. When adding a user while the Samba server is running, this command must be used to ensure that the smbpasswd file is properly locked before it is modified.

    Another way to create a new smbpasswd file is to use the mksmbpasswd.sh script that comes with Samba. This script is, oddly enough, stored in the /source subdirectory of the Samba distribution. For example:

    cat /etc/passwd | mksmbpasswd.sh > \
    /usr/local/samba/private/smbpasswd

    If the system uses NIS, you should use this command:

    ypcat passwd | mksmbpasswd.sh > \
    /usr/local/samba/private/smbpasswd

    After using the mksmbpasswd.sh script, edit the file by hand to remove root, bin and daemon just to be on the safe side.

    Finally, to allow users to update their encrypted password, set the permissions on smbpasswd to be setuid root as follows:

    chmod u+s /usr/local/samba/bin/smbpasswd

    <<

    Als 't werkt laat weten en leg uit hoe 't lukte!
    Alvast bedankt!

Posting Permissions

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