Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Windows 7, connecting to Samba shares

I have a follow up question from the link above.

I am running Samba 3.0.23d on FreeBSD is release 7.1

I changed the policies as described above but still cannot connect to the samba server with the windows 7 or a server 2008. I feel it is a problem with recognizing the new machines on the network. the windows machines can see the samba server, but cannot connect to it or view any of the files. After changing the security policies the samba server asked for network id and password but would not allow the machine to connect, said they were unknown username or bad password.

Here is my current config file. there is no sign of encryption anywhere, should I just add the line? not sure what that would do elsewhere.

Workgroup = WWOFFSET
server string = WWO File Server (%v)
security = server
username map = /usr/local/etc/smb.users
hosts allow = 10. 127.

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

# you may wish to override the location of the printcap file
;   printcap name = /etc/printcap

# on SystemV system setting printcap name to lpstat should allow
# you to automatically obtain a printer list from the SystemV spool
# system
;   printcap name = lpstat

# It should not be necessary to specify the print system type unless
# it is non-standard. Currently supported print systems include:
# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
;   printing = cups

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
;  guest account = pcguest

# 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 = 50

# Use password server option only with security = server
# The argument list may include:
#   password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
# or to auto-locate the domain controller/s
#   password server = *
;   password server = <NT-Server-Name>
   password server = SERVER0

# Use the realm option only with security = ads
# Specifies the Active Directory realm the host is part of
;   realm = MY_REALM

# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
;   passdb backend = tdbsam
;   passdb backend = smbpasswd

# 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.
# Note: Consider carefully the location in the configuration file of
#       this line.  The included file is read at that point.
;   include = /usr/local/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See the chapter 'Samba performance issues' in the Samba HOWTO Collection
# and the manual pages for details.
# You may want to add the following on a Linux system:
#         SO_RCVBUF=8192 SO_SNDBUF=8192
   socket options = TCP_NODELAY

# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
;   interfaces =

# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
;   local master = no

# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
;   os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
;   domain master = yes

# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
;   preferred master = yes

# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
;   domain logons = yes

# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
;   logon script = %m.bat
# run a specific logon batch file per username
;   logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)
#        %L substitutes for this servers netbios name, %U is username
#        You must uncomment the [Profiles] share below
;   logon path = \\%L\Profiles\%U

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
;   wins support = yes

# 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

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one  WINS Server on the network. The default is NO.
;   wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The default is NO.
   dns proxy = no

# charset settings
;   display charset = ASCII
;   unix charset = ASCII
;   dos charset = ASCII

# These scripts are used on a domain controller or stand-alone
# machine to add or delete corresponding unix accounts
;  add user script = /usr/sbin/useradd %u
;  add group script = /usr/sbin/groupadd %g
;  add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
;  delete user script = /usr/sbin/userdel %u
;  delete user from group script = /usr/sbin/deluser %u %g
;  delete group script = /usr/sbin/groupdel %g

unix extensions = no
share|improve this question
Did you specify the share(s) somewhere too? – Eroen Sep 20 '12 at 1:34

Sometimes there is a bit of a pitfall with Samba, depending on the platform. It (Samba) isn't always set up to use encrypted password. If you navigate to your /etc/smb.conf it should mention a config item alluding to encrypted passwords. Change the setting to the opposite of whatever its currently set to and then issue the command:

/etc/rc.d/samba restart <- Need to be root. Either prefix with sudo or drop into su.


/etc/rc.d/smbd restart <- Need to be root. Either prefix with sudo or drop into su.

It just kind of depends on the version as to what command is needed to restart Samba. I ran across this problem several years ago and it wooped me for quite some time. There is also an open source project out there called Webmin that is great for administering a *nix box either remotely or locally via a web browser. Just make sure the box is well protected if you should decide to use Webmin.

Here is a sample of an smb.conf from my network (Windows, Mac OS X, Linux, BSD) all talking to one another. The file below was harvested from a Mac.

    ; Configuration file for the Samba software suite.
; ============================================================================
; For the format of this file and comprehensive descriptions of all the
; configuration option, please refer to the man page for smb.conf(5).
; The following configuration should suit most systems for basic usage and
; initial testing. It gives all clients access to their home directories and
; allows access to all printers specified in /etc/printcap.

; BEGIN required configuration

; Parameters inside the required configuration block should not be altered.
; They may be changed at any time by upgrades or other automated processes.
; Site-specific customizations will only be preserved if they are done
; outside this block. If you choose to make customizations, it is your
; own responsibility to verify that they work correctly with the supported
; configuration tools.

    debug pid = yes
    log level = 1
    server string = Mac OS X

    printcap name = cups
    printing = cups

    **encrypt passwords = yes**
    use spnego = yes

    passdb backend = odsam

    idmap domains = default
    idmap config default: default = yes
    idmap config default: backend = odsam
    idmap alloc backend = odsam
    idmap negative cache time = 5

    map to guest = Bad User
    guest account = nobody

    unix charset = UTF-8
    display charset = UTF-8
    dos charset = 437

    vfs objects = notify_kqueue,darwinacl,darwin_streams

    ; Don't become a master browser unless absolutely necessary.
    os level = 2
    domain master = no

    ; For performance reasons, set the transmit buffer size
    ; to the maximum and enable sendfile support.
    max xmit = 131072
    use sendfile = yes

    mangled names = no
    stat cache = no
    wide links = no

    ; The darwin_streams module gives us named streams support.
    stream support = yes
    ea support = yes

    ; Enable locking coherency with AFP.
    darwin_streams:brlm = yes

    ; Core files are invariably disabled system-wide, but attempting to
    ; dump core will trigger a crash report, so we still want to try.
    enable core files = yes

    ; Filter inaccessible shares from the browse list. shares by access = yes

    ; Check in with PAM to enforce SACL access policy.
    obey pam restrictions = yes

    ; Make sure that we resolve unqualified names as NetBIOS before DNS.
    name resolve order = lmhosts wins bcast host

    ; Pull in system-wide preference settings. These are managed
    ; by smb-sync-preferences.
    include = /var/db/smb.conf

    ; Pull in system share configuration. These are managed
    ; by smb-sync-shares.
    include = /var/db/samba/smb.shares

    comment = All Printers
    path = /tmp
    printable = yes
    guest ok = no
    create mode = 0700
    writeable = no
    browseable = no

; Site-specific parameters can be added below this comment.
; END required configuration.
share|improve this answer
cod3monk3y I added my config file to my question. I do not see an encryption line anywhere in the config file. – Rick Sep 6 '11 at 13:50
C0D3M0NK3Y, Thanks for your help, I added my config file to my question hoping you can help some more. I do not see an encryption line anywhere in the config file. I thought maybe I could just add it but then I might have issues with the clients that currently can connect with the config file current settings. – Rick Sep 6 '11 at 16:27
Are those stars in **encrypt passwords = yes** part of the quote or just markdown syntax? – Eroen Sep 20 '12 at 15:12

I learned that SAMBA is a hit and miss sometimes. I had it configured on my ubuntu server, and I found it always difficult to connect to it through windows 7 machine.

You can start by looking at log files of Samba to see what exactly happens when you try to enter username/password from windows machine.

share|improve this answer

Depending on the version of the SMB protocol Windows is connecting with, you may wish to toggle the client use spnego = no option in your smb.conf (add it if its not there).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .