Solved: Samba browsing issue

Currently, I am in the process of setting up a home server, and one of the functions of this home server will be to host samba shares. The shares have already been setup, and the server is successfully sharing files between linux, OSX, and Windows machines. However, for some reason, when running OpenSUSE (Release 12.1 running Tumbleweed) on my machine, I cannot browse to the server’s samba shares. I have enabled both netbios and samba ports through the external zone on my firewall (have even tested with firewall off, which also didn’t work), and replaced the suggested the mentioned package in [http://forums.opensuse.org/english/get-technical-help-here/network-internet/468521-problem-samba-opensuse-12-1-re-systemd.html]this thread](http://forums.opensuse.org/english/get-technical-help-here/network-internet/468521-problem-samba-opensuse-12-1-re-systemd.html). If I direct dolphin directly to the samba shares (smb://192.168.1.101) there is not problem connecting, but when I try to browse to them, I get as far as opening the workgroup before I get a timeout error which reads “Timeout on server workgroup.” Employing Google to attempt to get a handle on this problem has yielded nothing thus far. Browsing to these shares from my Ubuntu install on the very same machine yields absolutely no issues at all.

Since I can point dolphin directly to the fileshare server, this isn’t a crippling problem, but it is a huge annoyance that I would love to be able to resolve. Any insights would be very appreciated!

On the openSUSE machine, could you share with us the contents of your samba config file? Open up a terminal session and type the command:

cat /etc/samba/smb.conf

You could then copy the text from terminal and paste the contents into a forum message using the advanced message editor. Then highlight only the smb.conf contents and pressing the # code button. It will say code: at the top, just like the command I posted above, but a larger window.

I might also direct you to a blog I have on the subject here:

Samba S.W.A.T. - Samba Web Administration Tool Setup for openSUSE - Blogs - openSUSE Forums

Thank You,

On Wed January 25 2012 07:26 pm, OakRaider4Life wrote:

>
> Currently, I am in the process of setting up a home server, and one of
> the functions of this home server will be to host samba shares. The
> shares have already been setup, and the server is successfully sharing
> files between linux, OSX, and Windows machines. However, for some
> reason, when running OpenSUSE (Release 12.1 running Tumbleweed) on my
> machine, I cannot browse to the server’s samba shares. I have enabled
> both netbios and samba ports through the external zone on my firewall
> (have even tested with firewall off, which also didn’t work), and
> replaced the suggested the mentioned package in
> ‘http://forums.opensuse.org/english/get-technical-help-here/network-internet/468521-problem-samba-opensuse-12-1-re-systemd.html]this
> thread’ (http://tinyurl.com/73nxp6x). If I direct dolphin directly to
> the samba shares (smb://192.168.1.101) there is not problem connecting,
> but when I try to browse to them, I get as far as opening the workgroup
> before I get a timeout error which reads “Timeout on server workgroup.”
> Employing Google to attempt to get a handle on this problem has yielded
> nothing thus far. Browsing to these shares from my Ubuntu install on the
> very same machine yields absolutely no issues at all.
>
> Since I can point dolphin directly to the fileshare server, this isn’t
> a crippling problem, but it is a huge annoyance that I would love to be
> able to resolve. Any insights would be very appreciated!
>
>
OakRaider4Life;

Is nmb running? nmb(d) does name resolution for netbios names and should be
started at boot.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

@OakRaider4Life

A good way to test whether the nmb daemon is running in 12.1 is this command: su -c “service nmb status; service smb status”
That should return two instances of “running”, like this:

john@opensuse121:~> su -c "service nmb status; service smb status"
Password: 
Checking for Samba NMB daemon                           running
Checking for Samba SMB daemon                           running

I checked to see if smbd and nmbd were running, and it turns out they in fact were not. So I ran both of them, but it ended up being to no avail. So here is my samba config file.

# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2011-11-02
[global]
        workgroup = WORKGROUP
        passdb backend = tdbsam
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        map to guest = Bad User
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        usershare allow guests = No
        security = domain
        idmap gid = 10000-20000
        idmap uid = 10000-20000
[homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        read only = No
        inherit acls = Yes
[profiles]
        comment = Network Profiles Service
        path = %H
        read only = No
        store dos attributes = Yes
        create mask = 0600
        directory mask = 0700
[users]
        comment = All users
        path = /home
        read only = No
        inherit acls = Yes
        veto files = /aquota.user/groups/shares/
[groups]
        comment = All groups
        path = /home/groups
        read only = No
        inherit acls = Yes
[printers]
        comment = All Printers
        path = /var/tmp
        printable = Yes
        create mask = 0600
        browseable = No
[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @ntadmin root
        force group = ntadmin
        create mask = 0664
        directory mask = 0775

Out of curiosity… I’m somewhat new to OpenSUSE and am more familiar with the command syntax of Ubuntu… so I was curious about why you go with

su -c

rather than

sudo

and similarly, why

"service smbd [command]"

is written in quotes as opposed to without them… just a bit of side note curiosity.

To be thorough, three “allowed services” should be opened in SuSEfirewall2: Netbios Server, Samba Client and Samba Server. These are found in Firewall → Allowed Services

You should set the daemons smb and nmb running permanently by going to Yast → System → runlevels and highlight nmb and set it to Enabled and likewise for smb

I would recommend changing the ]global] stanza of smb.conf so it reads like this:

[global]
workgroup = WORKGROUP
netbios name = name_of_this_workstation
name resolve order = bcast host lmhosts wins
server string =
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
use client driver = yes
map to guest = Bad User
local master = yes
preferred master = yes
os level = 33
passdb backend = tdbsam
usershare allow guests = Yes
usershare max shares = 100
usershare owner only = False

Change name_of_this_workstation to the name you want to see attached to the server in a network browser

These changes won’t become visible immediately, sometimes takes up to 15 minutes. I get impatient and reboot all the computers in the LAN sequentially, sometimes twice, just to force them all to see and register each other.

Regarding su -c: that form changes the path parameter from your current path environment (which is the path of the normal unprivileged user) to the path of the root user’s environment. Try running the command using sudo and you’ll get this: “sudo: service nmb status: command not found” because sudo uses your path environment which won’t locate the command “service”.

Why the quotation marks?: because su -c doesn’t link separate words in the command line together, unless you put them in quotes; single-word commands don’t need quotes.

It turns out that my server was not configured as properly as I thought. After attempting to access the Samba shares from Ubuntu again, I was unable to, and attempting to access them from OSX allowed me to browse, but not copy files to the share. If someone wouldn’t mind taking a look at the [global] section of my server’s smb.conf, I would very much appreciate any insight that can be provided.


[global]

## Browsing/Identification ###

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

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

# 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

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes



#### Debugging/Accounting ####

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

# Cap the size of the individual log files (in KiB).
   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/Samba3-HOWTO/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

   obey pam restrictions = yes

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

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n
 *Retype\snew\s*\spassword:* %n
 *password\supdated\ssuccessfully* .

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

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
;   domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
#   logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the 
# SAMR RPC pipe.  
# The following assumes a "machines" group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.  
; add group script = /usr/sbin/addgroup --force-badname %g

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

############ 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/Samba3-HOWTO/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

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
;   winbind enum groups = yes
;   winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
;   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

If someone wants to peek at any other section of my .conf file, I will of course happily tack it on as well.

Your last post is for the server, is it Ubuntu (or what?) and is the firewall on or off? And please show us the full file.

And next question: have you altered the smb.conf of the openSUSE client machine from the version you showed us in your second post, or is it still the same?

I altered the [Global] stanza of my SUSE smb.conf to the configuration you recommended. After doing that and making sure that the nmb daemon was running, I was able to get as far as browsing to the server folder share. Once browsing that far I’m met with either a server timeout or a login authentication screen which does not accept my server login credentials. As a quick aside though, I thought I had set nmbd to autostart (included /usr/sbin/nmbd in my KDE Autostart settings), but it apparently did not, as I had to start it again before doing a retest… Is there a better way to make sure the daemon gets autorun?

Sorry about the skimp on the details, obv I should have mentioned that my server is running a 64-bit install of Ubuntu 11.10, and UFW is enabled with ports 20-22, 137-139, 80, 445, and 631 open. If I need to take my issue over to the Ubuntu forum now that I’ve figured out it’s a server side problem, i can certainly do that. If you still want a look at my whole smb.conf file though, it’s posted below


#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which 
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  - When such options are commented with ";", the proposed setting
#    differs from the default Samba behaviour
#  - When commented with "#", the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic 
# errors. 
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#

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

[global]

## Browsing/Identification ###

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

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

# 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

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes



#### Debugging/Accounting ####

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

# Cap the size of the individual log files (in KiB).
   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/Samba3-HOWTO/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

   obey pam restrictions = yes

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

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n
 *Retype\snew\s*\spassword:* %n
 *password\supdated\ssuccessfully* .

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

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
;   domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
#   logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the 
# SAMR RPC pipe.  
# The following assumes a "machines" group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.  
; add group script = /usr/sbin/addgroup --force-badname %g

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

############ 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/Samba3-HOWTO/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

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
;   winbind enum groups = yes
;   winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
;   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

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

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each 
# user's home director as \\server\username
;[homes]
;   comment = Home Directories
;   browseable = no

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

# 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

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
# The following parameter makes sure that only "username" can connect
#
# This might need tweaking when using external authentication schemes
;   valid users = %S

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

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = yes
   path = /var/spool/samba
   printable = yes
   guest ok = yes
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

[Server Home]
Comment = Fileserver Shares
path = /home
guest ok = yes
browsable = yes
create mask = 755
valid users = %S
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
;   comment = Samba server's CD-ROM
;   read only = yes
;   locking = no
;   path = /cdrom
;   guest ok = 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

These are the real contents of your file on Ubuntu.

[global]
server string = %h server (Samba, Ubuntu)
workgroup = WORKGROUP
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = Enter\snew\s\spassword:* %n
Retype\snew\s\spassword:* %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
idmap config * : backend = tdb

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

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

[Server Home]
comment = Fileserver Shares
path = /home
valid users = %S
create mask = 0755
guest ok = Yes

You should back up the file and then replace it. This will back it up:

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.orig

Then overwrite the original Ubuntu file with this:

[global]
workgroup = WORKGROUP
passdb backend = tdbsam
netbios name = Ubuntu Server
name resolve order = bcast host lmhosts wins
server string = “”
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
use client driver = yes
map to guest = Bad User
local master = yes
preferred master = yes
os level = 65
usershare allow guests = Yes
usershare max shares = 100
usershare owner only = False

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

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

[Server Home]
comment = Fileserver Shares
path = /home
valid users = %S
create mask = 0755
guest ok = Yes

I’ve changed Ubuntu [global] to make it compatible with openSUSE (and others like it), windows and apple workstations.

To get Samba permanently “on” in openSUSE, goto Yast → system → runlevels and find smb and make sure it’s set to to “enabled” = “yes”. Do same for nmb.

Regarding the Ubuntu firewall: for the time being turn it off with this command:

sudo ufw disable

That will turn it off permanently. When good browsing has been established, you can turn it back on with this

sudo ufw enable

Regarding the openSUSE firewall, this command please run it and post results back here so I can see if it’s properly configured (you might have to use copy/paste to avoid typos):

cat /etc/sysconfig/SuSEfirewall2 | egrep "FW_CONFIGURATIONS_EXT=|FW_DEV_EXT="

Next thing: now that I understand your Ubu server and openSUSE client arrangement, you should change this line in the openSUSE smb.conf “preferred master = yes” to this form “preferred master = auto” which is the best for for a “client”.

Finally, I have reservations about the stanza you put into Ubuntu’s smb.conf. Is it meant to make available to any user the contents of a particular home directory on the Ubu server without needing to log in over the Samba network? Or what exactly do you want to achieve there?

The output of the command you mentioned was

FW_DEV_EXT="eth0 wlan0"
FW_CONFIGURATIONS_EXT="netbios-server ntp samba-client"

I changed the setting you recommended in SUSE’s smb.conf, but samba is still not accepting any login credentials.

I’ll try to aptly explain what I’m going for with my folder configuration… The server has two users, and I want any guest on the local network to be able to read and execute from either user’s home directory. I want the users to be able to have rwx permission in their own directory, while having r-x permission in the other user’s directory.

After a little more toying around with my smb.conf, I discovered that this particular issue appears to be with defining my valid users for the home share. When I commented out valid users and made the folder public, I had no problem browsing to and accessing the folder. After messing with the config a little more, this is what it looks like at present… and it still will not validate users.


[global]
workgroup = WORKGROUP
passdb backend = tdbsam
netbios name = Ubuntu Server
name resolve order = bcast host lmhosts wins
server string = ""
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
use client driver = yes
map to guest = Bad User
local master = yes
preferred master = yes
os level = 65
usershare allow guests = Yes
usershare max shares = 100
usershare owner only = False
security = share
#username map = /etc/samba/smbusers

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

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

[Server Home]
comment = Fileserver Shares
path = /home
valid users = james,deyla
#For valid users, I also tried
#valid users = %S
#valid users = %U
#valid users = %u
#valid users = @users
create mask = 0755
guest ok = yes
browsable = yes
writable = yes
#public = yes

guest ok = yes implies that valid users are everyone in the world and that conflicts with the “valid users” property. The only way you can discriminate between users is to identify the users to Samba, and that requires a login (authentication).

On the Ubu server, what does this return: sudo pdbedit -L

On Tue February 14 2012 01:46 pm, swerdna wrote:

>
> guest ok = yes implies that valid users are everyone in the world and
> that conflicts with the “valid users” property. The only way you can
> discriminate between users is to identify the users to Samba, and that
> requires a login (authentication).
>
> On the Ubu server, what does this return: sudo pdbedit -L
>
>
OakRaider4Life;

Consider using the parameters:


writeable=no
write list = james,deyla

The default value for writeable is no so it does not actually need to be set.
Also note that parameter “read only” is merely the inverse of “writeable”.
For details see man smb.conf.

http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html

If you want the guest account to have read privileges, leave in the parameter:


guest ok = yes

As the share can only be written to by the users in the write list, this will
make the share read only to anyone else including the guest account.

This means that only james and deyla may write to the share, for others it is
read only.

It is not clear to me if the above smb.conf is from SuSE or Ubuntu. The shares
must be defined on Ubuntu and the users exist as valid Samba users on Ubuntu

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Thank you for your responses.

The command output you inquired about returns the following


nobody:65534:nobody
deyla:1001:
root:0:root
james:1000:James Lott

I removed the “valid users” property to keep “guest” as “= ok”, and created a write list with the users as recommended. I also changed the configuration so each user has direct access to their own home folder, while having read only access to the other user’s folder. The smb.conf on the Ubu server now looks like this


[global]
workgroup = WORKGROUP
passdb backend = tdbsam
netbios name = Ubuntu Server
name resolve order = bcast host lmhosts wins
server string = ""
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
use client driver = yes
map to guest = Bad User
local master = yes
preferred master = yes
os level = 65
usershare allow guests = Yes
usershare max shares = 100
usershare owner only = False
security = share
#username map = /etc/samba/smbusers

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

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

[Deyla's Home]
comment = Deyla's Home folder
path = /home/deyla
create mask = 0755
guest ok = yes
browsable = yes
write list = deyla
public = yes

[James' Home]
comment = James' Home folder
path = /home/james
create mask = 0755
guest ok = yes
browsable = yes
write list = james
public = yes

This has given me the desired result, exempting one peripheral issue. Now that the folders have allowed guest access and they are writable only by their respective users, there is not prompt for a login before accessing the shares, meaning they can’t be written to. I’m sure it’s something simple on the client side (Client side is SUSE 12.1 running Tumbleweed) that I’m not doing, I’m just not sure what that is. I tried to access the samba share by punching “james@[UbuServerIP]” into dolphin, but it doesn’t prompt me for a password… how can I access the Samba share from Dolphin using credentials?

This will work for restricted writes and unrestricted reads:

change
security = share
to
security = user

and re-do these [stanzas]

[Deyla’s Home]
comment = Deyla’s Home folder
path = /home/deyla
force user = deyla
write list = deyla
valid users = deyla james

[James’s Home]
comment = James’s Home folder
path = /home/james
force user = james
write list = james
valid users = deyla james

and add deyla and james to the samba users on the server

My samba server is now configured and running exactly as I would like it to, with my SUSE client being fully cooperative.

Thank you everyone for your help throughout this long-running troubleshoot!

P.S. - Do I need to do something to mark this thread as solved?

Also, I found Swerdina’s samba configuration page (http://opensuse.swerdna.org/susesambaserver.html) which also ended up proving quite helpful.

Glad we could help. & I’ll mark it solved for you]

Hi there, sorry to barge in.

I am having the same issue with samba (read to guest, and have auth’d users being able to write, but dolphin won’t let me authenticate if guest ok=yes).

My server is freenas (bsd) though.
Currently, I worked around it by making a user called anon with password anon and not having guest access, which is not really what I wanted.

When you used swerdna’s instructions, did you get the behaviour you wanted (ie, guest = read, dolphin auth=write)?
if it did, would you mind posting your server’s smb.conf so I can copy it? And anything special you had to do on the client?

Thanks! If it works I’ll be a happy bunny.

I am having the same issue with samba (read to guest, and have auth’d users being able to write, but dolphin won’t let me authenticate if guest ok=yes)

Guest access goes around the authentication process, and in most instances will log you on as user “nobody”. Thus you end up with no write access.

What is it that you want to achieve?