Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, Im beginning to explore Linux Debian and I'm trying to get Samba to work. So I'm still a bit of a noob, and discovering Linux while I go. I've ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006

    [Samba] Win XP asks for a password?

    Hi, Im beginning to explore Linux Debian and I'm trying to get Samba to work. So I'm still a bit of a noob, and discovering Linux while I go.

    I've installed Samba with

    apt-get install samba

    And made a few changes to the smb.conf file. I can now ping my Linux machine called Debian using its domainname instead of the local ip address. But when I try to connect with Windows Explorer to "Debian" it asks for a username and password but I don't recall ever supplying Samba with them, Ive tried to login with a user account I created in Linux but it doesn't seem to work. So I'm kind of stuck, please help me out.

    This is my smb.conf file

    #======================= Global Settings =======================


    ## Browsing/Identification ###

    # Change this to the workgroup/NT-domain name your Samba server will part of
    workgroup = BRUIJN

    # server string is the equivalent of the NT Description field
    server string = %h server (Samba %v)

    # Windows Internet Name Serving Support Section:
    # WINS Support - Tells the NMBD component of Samba to enable its WINS Server
    ; wins support = no

    # WINS Server - Tells the NMBD components of Samba to be a WINS Client
    # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
    ; wins server = w.x.y.z

    # This will prevent nmbd to search for NetBIOS names through DNS.
    dns proxy = no

    # What naming service and in what order should we use to resolve host names
    # to IP addresses
    ; name resolve order = lmhosts host wins bcast

    #### Debugging/Accounting ####

    # This tells Samba to use a separate log file for each machine
    # that connects
    log file = /var/log/samba/log.%m

    # Put a capping on the size of the log files (in Kb).
    max log size = 1000

    # If you want Samba to only log through syslog then set the following
    # parameter to 'yes'.
    ; syslog only = no

    # We want Samba to log a minimum amount of information to syslog. Everything
    # should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
    # through syslog you should set the following parameter to something higher.
    syslog = 0

    # Do something sensible when Samba crashes: mail the admin a backtrace
    panic action = /usr/share/samba/panic-action %d

    ####### Authentication #######

    # "security = user" is always a good idea. This will require a Unix account
    # in this server for every user accessing the server. See
    # /usr/share/doc/samba-doc/htmldocs/ServerType.html in the samba-doc
    # package for details.
    security = user

    # You may wish to use password encryption. See the section on
    # 'encrypt passwords' in the smb.conf(5) manpage before enabling.
    encrypt passwords = true

    # If you are using encrypted passwords, Samba will need to know what
    # password database type you are using.
    passdb backend = tdbsam guest

    obey pam restrictions = yes

    ; guest account = nobody
    invalid users = root

    # This boolean parameter controls whether Samba attempts to sync the Unix
    # password with the SMB password when the encrypted SMB password in the
    # passdb is changed.
    ; unix password sync = no

    # For Unix password sync to work on a Debian GNU/Linux system, the following
    # parameters must be set (thanks to Augustin Luton <> for
    # sending the correct chat script for the passwd program in Debian Potato).
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .

    # This boolean controls whether PAM will be used for password changes
    # when requested by an SMB client instead of the program listed in
    # 'passwd program'. The default is 'no'.
    ; pam password change = no

    ########## Printing ##########

    # If you want to automatically load your printer list rather
    # than setting them up individually then you'll need this
    ; load printers = yes

    # lpr(ng) printing. You may wish to override the location of the
    # printcap file
    ; printing = bsd
    ; printcap name = /etc/printcap

    # CUPS printing. See also the cupsaddsmb(8) manpage in the
    # cupsys-client package.
    ; printing = cups
    ; printcap name = cups

    # When using [print$], root is implicitly a 'printer admin', but you can
    # also give this right to other users to add drivers and set printer
    # properties
    ; printer admin = @ntadmin

    ######## File sharing ########

    # Name mangling options
    ; preserve case = yes
    ; short preserve case = yes

    ############ Misc ############

    # Using the following line enables you to customise your configuration
    # on a per machine basis. The %m gets replaced with the netbios name
    # of the machine that is connecting
    ; include = /home/samba/etc/smb.conf.%m

    # Most people will find that this option gives better performance.
    # See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/speed.html
    # for details
    # You may want to add the following on a Linux system:
    # SO_RCVBUF=8192 SO_SNDBUF=8192
    socket options = TCP_NODELAY

    # The following parameter is useful only if you have the linpopup package
    # installed. The samba maintainer and the linpopup maintainer are
    # working to ease installation and configuration of linpopup and samba.
    ; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

    # Domain Master specifies Samba to be the Domain Master Browser. If this
    # machine will be configured as a BDC (a secondary logon server), you
    # must set this to 'no'; otherwise, the default behavior is recommended.
    ; domain master = auto

    # Some defaults for winbind (make sure you're not using the ranges
    # for something else.)
    ; idmap uid = 10000-20000
    ; idmap gid = 10000-20000
    ; template shell = /bin/bash

    #======================= Share Definitions =======================

    comment = Shared Files
    path = /home/ftp
    writable = yes
    guest ok = yes

    comment = Home Directories
    browseable = no

    # By default, the home directories are exported read-only. Change next
    # parameter to 'yes' if you want to be able to write to them.
    writable = no

    # File creation mask is set to 0700 for security reasons. If you want to
    # create files with group=rw permissions, set next parameter to 0775.
    create mask = 0700

    # Directory creation mask is set to 0700 for security reasons. If you want to
    # create dirs. with group=rw permissions, set next parameter to 0775.
    directory mask = 0700

    # Un-comment the following and create the netlogon directory for Domain Logons
    # (you need to configure Samba to act as a domain controller too.)
    ; comment = Network Logon Service
    ; path = /home/samba/netlogon
    ; guest ok = yes
    ; writable = no
    ; share modes = no

    comment = All Printers
    browseable = no
    path = /tmp
    printable = yes
    public = no
    writable = no
    create mode = 0700

    # Windows clients look for this share name as a source of downloadable
    # printer drivers
    comment = Printer Drivers
    path = /var/lib/samba/printers
    browseable = yes
    read only = yes
    guest ok = no
    # Uncomment to allow remote administration of Windows print drivers.
    # Replace 'ntadmin' with the name of the group your admin users are
    # members of.
    ; write list = root, @ntadmin

    # A sample share for sharing your CD-ROM with others.
    ; comment = Samba server's CD-ROM
    ; writable = no
    ; locking = no
    ; path = /cdrom
    ; public = yes

    # The next two parameters show how to auto-mount a CD-ROM when the
    # cdrom share is accesed. For this to work /etc/fstab must contain
    # an entry like this:
    # /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
    # The CD-ROM gets unmounted automatically after the connection to the
    # If you don't want to use auto-mounting/unmounting make sure the CD
    # is mounted on /cdrom
    ; preexec = /bin/mount /cdrom
    ; postexec = /bin/umount /cdrom

  2. #2
    Just Joined! sin@evilson's Avatar
    Join Date
    Nov 2006
    So California

    Samba and XP

    The output of smbpasswd is as follows:

    [sin@evilson ~]$ smbpasswd --help
    smbpasswd: invalid option -- -
    When run by root:
    smbpasswd [options] [username]
    smbpasswd [options]

    -L local mode (must be first option)
    -h print this usage message
    -s use stdin for password prompt
    -c smb.conf file Use the given path to the smb.conf file
    -D LEVEL debug level
    -r MACHINE remote machine
    -U USER remote username
    extra options when run by root or in local mode:
    -a add user
    -d disable user
    -e enable user
    -i interdomain trust account
    -m machine trust account
    -n set no password
    -W use stdin ldap admin password
    -w PASSWORD ldap admin password
    -x delete user
    -R ORDER name resolve order

    So in your XP workstation you'll want to add an account (username) to use on the Samba Server and the XP machine. Then add the user on the Samba Server using `smbpasswd -a username` this will prompt for the password for that acocunt. Make sure that the passwords are the same on your XP Workstation and your Samba Server. OR you can change your smb.conf option as follows: ` security = share` and then change the permissions on the directory so that everyone has rwx on that directory. There are hundred ways to accomplish this. These are merely two ways. Some good reading on this subject can be found at:

  3. #3
    Join Date
    Apr 2009
    I know this post is old but it was the first one that came up on google doing a search.

    The solution above is annoying and messy. Here is a better one in my opinion (less secure though).

    Just change "security = user" to "security = share" inn your smb.conf. On a local network this should be fine.

  4. $spacer_open
  5. #4
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Nottingham, England
    I disagree - the correct solution is the one above. The solution to problems with security is never to turn the security OFF unless you can trust the environment in which it sits.

    Anyway, this is an old thread, hence I'm locking it. If you have more queries about this, start a new thread to ask.
    Linux user #126863 - see

Posting Permissions

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