You are not logged in.

#1 2012-11-16 19:51:15

eherranzr
Member
Registered: 2011-06-28
Posts: 112

[SOLVED] Fail using Samba

Hi!

I have a WD TV Live in the living room connected to the TV and I have my PC in another room. In this PC I have all my films and series.
I'd like to acces from the WD TV Live to my PC films and reproduce them from the WD.
The solution to this is sharing folders (either Samba or NFS)
I choose Samba because I think there's more info around the web.
So, I installed and configured (I think correctly) the /etc/samba/smb.conf file:

[global]
netbios name = Samba24
server string = Samba file and print server
workgroup = WORK_GROUP
security = user
username map = /etc/samba/smbusers
hosts allow = 127. 192.168.0.
interfaces = 127.0.0.1/8 192.168.0.0/24
bind interfaces only = yes
remote announce = 192.168.0.255
remote browse sync = 192.168.0.255
printcap name = cups
load printers = yes
cups options = raw
printing = cups
guest account = smbguest
log file = /var/log/samba/samba.log
max log size = 1000
null passwords = no
username level = 6
password level = 6
encrypt passwords = yes
unix password sync = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = no
domain master = no
preferred master = no
domain logons = no
os level = 33
logon drive = m:
logon home = \\%L\homes\%u
logon path = \\%L\profiles\%u
logon script = %G.bat
time server = no
name resolve order = wins lmhosts bcast
wins support = no
wins proxy = no
dns proxy = no
preserve case = yes
short preserve case = yes
client use spnego = yes
client signing = yes
client schannel = yes
server signing = yes
server schannel = yes
nt pipe support = yes
nt status support = yes
allow trusted domains = no
obey pam restrictions = yes
enable spoolss = yes
client plaintext auth = no
disable netbios = no
follow symlinks = no
update encrypted = yes
pam password change = no
passwd chat timeout = 120
hostname lookups = no
username map = /etc/samba/smbusers
passdb backend = tdbsam
passwd program = /usr/bin/passwd '%u'
passwd chat = *New*password* %n\n *ReType*new*password* %n\n *passwd*changed*\n
add user script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null '%u'
add user to group script=/usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null -g '%g' '%u'
add group script = /usr/sbin/groupadd '%g'
delete user script = /usr/sbin/userdel '%u'
delete user from group script = /usr/sbin/userdel '%u' '%g'
delete group script = /usr/sbin/groupdel '%g'
add machine script = /usr/sbin/useradd -d /dev/null -g sambamachines -c 'Samba Machine Account' -s /dev/null -M '%u'
machine password timeout = 120
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /dev/null
winbind use default domain = yes
winbind separator = @
winbind cache time = 360
winbind trusted domains only = yes
winbind nested groups = no
winbind nss info = no
winbind refresh tickets = no
winbind offline logon = no

[homes]
comment = Home Directories
path = /home
valid users = %U
read only = yes
available = no
browseable = no
writable = no
guest ok = no
printable = no
locking = no
strict locking = no

[netlogon]
comment = Network Logon Service
path = /var/lib/samba/netlogon
read only = no
available = yes
browseable = yes
writable = no
guest ok = no
printable = no
locking = no
strict locking = no

[profiles]
comment = User Profiles
path = /var/lib/samba/profiles
read only = no
available = yes
browseable = yes
writable = yes
guest ok = no
printable = no
create mode = 0600
directory mask = 0700
locking = no
strict locking = no

[printers]
comment = All Printers
path = /var/spool/samba
browseable = yes
writable = no
guest ok = no
printable = yes
locking = no
strict locking = no

[pdf-documents]
path = /var/lib/samba/pdf-documents
comment = Converted PDF Documents
admin users = %U
available = yes
browseable = yes
writeable = yes
guest ok = yes
locking = no
strict locking = no

[pdf-printer]
path = /tmp
comment = PDF Printer Service
printable = yes
guest ok = yes
use client driver = yes
printing = bsd
print command = /usr/bin/gadmin-samba-pdf %s %u
lpq command =
lprm command =

[Descargas]
comment = Descargas
read only = no
writeable = yes
path = /home/emilio/Descargas/
valid users = emilio

[HDD]
comment = HDD
read only = no
writeable = yes
path = /media/HDD/
valid users = emilio

I just need to share /home/emilio/Descargas/ and /media/HDD/ I don't need to share the whole /home# Unix_name = SMB_Name1 SMB_Name2 ...

I also edited the /etc/samba/smbusers file:

root = administrator
nobody = guest smbguest pcguest
emilio = "emilio"

And I started samba:

sudo rc.d start samba
:: Starting Samba Server                                                                                                [DONE] 

But from the WD my PC doesn't appear. I'm also sure it's not a WD's problem because I can see other computers.
Maybe something is not correctly configured? The ips or something like that? The workgroup is correct
Would it be easier to use NFS? Could someone explain me how to do it?

Here I leave the ifconfig output (part of it) if it's usefull:

inet 192.168.1.35  netmask 255.255.255.0  broadcast 192.168.1.255

If something more is needed please ask me for it

Thanks to everybody

Last edited by eherranzr (2012-11-18 20:42:15)

Offline

#2 2012-11-17 12:47:23

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

Nobody?

Offline

#3 2012-11-17 14:05:23

dschrute
Member
From: NJ, USA
Registered: 2007-04-09
Posts: 183

Re: [SOLVED] Fail using Samba

1st, you have possibly way too much in your [global] section.  Most of that likely isn't needed, and at best it just clutters things up, at worst it can cause issues.  For example that windbind stuff...Are you integrating with AD ?  If not it's completely uneeded.  Also the "name resolve order" line is telling Samba to use WINS first.  Do you have a WINS server ?
Your best bet is to start with a very basic smb.conf and add to it.  The wiki has a decent overview of getting started.  I'd use that as a base, and mod as needed.

2nd, is basic name resolution working ?  Can you ping your Samba machine by name from the client ?  If not you'll have problems even if Samba is set up correctly.

In short, start with the basics and a simple config, then add to it.

Offline

#4 2012-11-17 14:56:53

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

dschrute wrote:

1st, you have possibly way too much in your [global] section.  Most of that likely isn't needed, and at best it just clutters things up, at worst it can cause issues.  For example that windbind stuff...Are you integrating with AD ?  If not it's completely uneeded.  Also the "name resolve order" line is telling Samba to use WINS first.  Do you have a WINS server ?
Your best bet is to start with a very basic smb.conf and add to it.  The wiki has a decent overview of getting started.  I'd use that as a base, and mod as needed.

2nd, is basic name resolution working ?  Can you ping your Samba machine by name from the client ?  If not you'll have problems even if Samba is set up correctly.

In short, start with the basics and a simple config, then add to it.

I've followed your advice and modified the basic smb.conf.default
This is now my smb.comf file:

# 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 (perhaps too
# many!) most of which are not shown in this example
#
# For a step to step guide on installing, configuring and using samba, 
# read the Samba-HOWTO-Collection. This may be obtained from:
#  http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# Many working examples of smb.conf files can be found in the 
# Samba-Guide which is generated daily and can be downloaded from: 
#  http://www.samba.org/samba/docs/Samba-Guide.pdf
#
# Any line which starts with a ; (semi-colon) or a # (hash) 
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors. 
#
#======================= Global Settings =====================================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = WORK_GROUP

# server string is the equivalent of the NT Description field
   server string = Samba Server

# Security mode. Defines in which mode Samba will operate. Possible 
# values are share, user, server, domain and ads. Most people will want 
# user level security. See the Samba-HOWTO-Collection for details.
   security = user

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
   hosts allow = 192.168.1.

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

# 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/%m.log

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

# 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

# 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/samba/lib/smb.conf.%m

# 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 = 192.168.12.2/24 192.168.13.2/24 

# 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 

# 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


#============================ Share Definitions ==============================
[homes]
   comment = Home Directories
   browseable = no
   writable = yes

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
;   comment = Network Logon Service
;   path = /usr/local/samba/lib/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 = /usr/local/samba/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
;   guest ok = no
;   writable = no
;   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
;   writable = no
;   printable = no
;   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

[Descargas]
comment = Descargas
path = /home/emilio/Descargas/
valid users = emilio
public = no
writable = yes

[HDD]
comment = HDD
path = /media/HDD/
valid users = emilio
public = no
writable = yes

Now, about your 2nd point. I want to acces to the Samba machine from a WD TV Live where the only way to access to the Samba machine is by the machine. Maybe, it would be useful to try to acces this Samba machine from another PC? How could I do this?


I've tried to acces from the WD TV Live and my Samba machine is found, but when I try to access it, I'm asked for an user and a password.
I've created the emilio user by:

sudo useradd -s emilio

and added a password:

sudo smbpasswd -a emilio

but when I try to acces with this user and password it says they're incorrect.
This is my smbusers file:

# Unix_name = SMB_Name1 SMB_Name2 ...
root = administrator
anonymous = guest smbguest pcguest
emilio = emilio

My linux user is emilio and it has a password, do I have to do something else?

Thanks
Regards

Last edited by eherranzr (2012-11-17 17:23:38)

Offline

#5 2012-11-17 18:16:26

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

Please...

Offline

#6 2012-11-17 19:31:10

Antoine
Member
From: Picton Ontario
Registered: 2012-10-11
Posts: 90

Re: [SOLVED] Fail using Samba

eherranzr wrote:

Please...

I'm not a great Samba guy; I run it from OS X using SMBUp,  but I do notice this in your smb.conf:

hosts allow = 127. 192.168.0.

while you seem to report your ip address as

192.168.1.35

and while I may be off the mark, it looks like you're not allowing your newtork to connect. Change the 0 to a 1 maybe? [Edit] Oh, I see you did that in your updated smb.conf; sorry.

[Edit]
I also have a WD Live. When it asks for my username and password, it's not asking for a samba username and password, it's asking for  the name and password that I use to login to my computer. It sees (and plays) the stuff I've shared from that computer. Again, though, this is OS X doing the sharing.

Last edited by Antoine (2012-11-17 19:42:47)

Offline

#7 2012-11-17 20:10:52

dschrute
Member
From: NJ, USA
Registered: 2007-04-09
Posts: 183

Re: [SOLVED] Fail using Samba

The fact you're connecting now is good, one step closer.  Check the permissions on the directory you're trying to connect to, and make sure the emilio user has access.

Offline

#8 2012-11-17 20:18:31

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED] Fail using Samba

I am not clear on one thing.  Are you saying that you cannot see the PC , or that you cannot log into it? 

If you cannot see it, you may want to look into Avahi (it is in the wiki).  It allows systems to autodiscover each other using either Apple's Bonjour, or Microsoft's whetever-it-is-they-call-it-today.

Otherwise, just tell tell the WD to go to the IP address of the server.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#9 2012-11-17 23:58:10

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

I have the same user with the same password both in the system and in samba (emilio)
These are the permisions of:
drwxr-xr-x 119 emilio users  28672 nov 17 17:51 Descargas
drwxrwxrwx 1 root   root  4096 nov 16 18:38 HDD
From the WD I can find my PC and when I try to connect to it I'm asked for an user and a password. I've tried with my Linux user, my samba user, root user, guest with no password, anonymous with no password... But I always get the same error, user or password are not correct.
Above these lines there are my smb.conf file and my smbusers file. I think everything is correct in these files (not sure if smbusers is completely right) but I still can not authenticate.

Thanks to everyone for reading and answering

Offline

#10 2012-11-18 11:16:42

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

Up!

Offline

#11 2012-11-18 14:54:22

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

Somebody please! We're close to find the solution

Last edited by eherranzr (2012-11-18 14:55:07)

Offline

#12 2012-11-18 15:12:05

pvibert
Member
Registered: 2011-07-18
Posts: 12

Re: [SOLVED] Fail using Samba

Which version of Samba are you running? 3.4.0 and higher don't use smbpasswd by default:
https://wiki.archlinux.org/index.php/Sa … sion_3.4.0

Offline

#13 2012-11-18 15:41:50

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

I should have skipped reading that when I read everything about samba on the wiki
I'm running samba 3.6.9-1 so smbpasswd is not used with this version.
Wiki says:

To stick to the 'smbpasswd' backend try changing this in /etc/samba/smb.conf:

passdb backend = smbpasswd

or convert the smbpasswd entries using:

sudo pdbedit -i smbpasswd -e tdbsam

Which one is recommended to do? I've already created an user (emilio) and a password for it (ussing smbpasswd). I
I've added

passdb backend = smbpasswd

to my smb.conf and tried to access from the WD to the shared folders. I'm asked again for the user and password. I put emilio and the password but still the same.
Any idea?

[EDIT] In my smb.conf I've found the following text:

# 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

Shouls this line be uncommented?
Maybe I should change the security method (user, share...)

After trying to execute

sudo pdbedit -i smbpasswd -e tdbsam

I get this output

Importing account for emilio...ok

Last edited by eherranzr (2012-11-18 16:01:32)

Offline

#14 2012-11-18 15:58:01

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

Further info:
When executing dolphin from konsole I get the following messages:

dolphin(29061) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
WARNING: 'workgroup' and 'netbios name' must differ.

Last edited by eherranzr (2012-11-18 16:00:57)

Offline

#15 2012-11-18 16:01:24

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED] Fail using Samba

Maybe you should fix your smb.config file smile

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

That should be a yes, or no.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#16 2012-11-18 16:09:24

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

ewaller wrote:

Maybe you should fix your smb.config file smile

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

That should be a yes, or no.

I just figured it out later. I have now corrected the smb.conf and it looks like this:

# 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 (perhaps too
# many!) most of which are not shown in this example
#
# For a step to step guide on installing, configuring and using samba, 
# read the Samba-HOWTO-Collection. This may be obtained from:
#  http://www.samba.org/samba/docs/Samba-HOWTO-Collection.pdf
#
# Many working examples of smb.conf files can be found in the 
# Samba-Guide which is generated daily and can be downloaded from: 
#  http://www.samba.org/samba/docs/Samba-Guide.pdf
#
# Any line which starts with a ; (semi-colon) or a # (hash) 
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors. 
#
#======================= Global Settings =====================================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = WORK_GROUP

# server string is the equivalent of the NT Description field
   server string = Samba Server

# Security mode. Defines in which mode Samba will operate. Possible 
# values are share, user, server, domain and ads. Most people will want 
# user level security. See the Samba-HOWTO-Collection for details.
   security = user

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
   hosts allow = 192.168.1.

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

# 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/%m.log

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

# 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

# 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/samba/lib/smb.conf.%m

# 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 = 192.168.12.2/24 192.168.13.2/24 

# 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 

# 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

#============================ Share Definitions ==============================
;[homes]
;   comment = Home Directories
;   browseable = no
;   writable = yes

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
;   comment = Network Logon Service
;   path = /usr/local/samba/lib/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 = /usr/local/samba/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
;   guest ok = no
;   writable = no
;   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
;   writable = no
;   printable = no
;   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

[Descargas]
comment = Descargas
path = /home/emilio/Descargas/
valid users = emilio guest
guest ok = yes
public = no
writable = yes

[HDD]
comment = HDD
path = /media/HDD/
valid users = emilio guest
guest ok = yes
public = no
writable = yes

Now, GOOD NEWS! I've managed to connect with the samba machine. First I tried using emilio and it's password but I get the same error "User or password are not correct" After that I tried with guest and no password and... VOILA! I'm in. For me that's ok. Theres just one more error. When I get in as a guest, the WD says there are not shared files on current folder. Any idea?

Offline

#17 2012-11-18 16:21:22

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

Furthermore, when I try to share a folder from dolphin I get this output:

libpng warning: Unknown iTXt compression type or method
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
dolphin(30742) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
WARNING: 'workgroup' and 'netbios name' must differ.
" 
dolphin(30742)/kdecore (services) KServicePrivate::init: The desktop entry file  "/home/emilio/Descargas/.directory"  has Type= "Application"  but no Exec line 

"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Invalid iterator."
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Invalid iterator."
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Invalid iterator."
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Invalid iterator."
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(30742)" Soprano: "Invalid iterator."
dolphin(30742) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
WARNING: 'workgroup' and 'netbios name' must differ.
" 
dolphin(30742) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
WARNING: 'workgroup' and 'netbios name' must differ.
" 
dolphin(30742) KSambaSharePrivate::add: We got some errors while running 'net usershare add' ("usershare", "add", "Descargas", "/home/emilio/Descargas", "", "Everyone:f,emilio:f", "guest_ok=y") 
dolphin(30742) KSambaSharePrivate::add: "net usershare: usershares are currently disabled
" 
dolphin(30742)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(30742)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(30742)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(30742)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(30742)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(30742)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:

So, I've tried this solution
But I still having this output:

libpng warning: Unknown iTXt compression type or method                                                                                                                                         
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"                                                   
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"                                                   
dolphin(31427) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf                                                
Loaded services file OK.                                                                                                                                                                        
WARNING: 'workgroup' and 'netbios name' must differ.                                                                                                                                            
"                                                                                                                                                                                               
dolphin(31427)/kdecore (services) KServicePrivate::init: The desktop entry file  "/home/emilio/Descargas/.directory"  has Type= "Application"  but no Exec line                                 
                                                                                                                                                                                                
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"                                                   
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"                                                   
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"                                                                                                                 
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"                                                                                                                 
"/usr/bin/dolphin(31427)" Soprano: "Invalid iterator."                                                                                                                                          
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"                                                   
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"                                                   
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"                                                                                                                 
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(31427)" Soprano: "Invalid iterator."
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(31427)" Soprano: "Invalid iterator."
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(31427)" Soprano: "Invalid iterator."
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(31427)" Soprano: "Could not connect to server at /tmp/ksocket-emilio/nepomuk-socket (No existe el fichero o el directorio)"
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(31427)" Soprano: "Unsupported operation (2)": "Invalid model"
"/usr/bin/dolphin(31427)" Soprano: "Invalid iterator."
dolphin(31427) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
WARNING: 'workgroup' and 'netbios name' must differ.
" 
dolphin(31427) KSambaSharePrivate::testparmParamValue: We got some errors while running testparm "Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
WARNING: 'workgroup' and 'netbios name' must differ.
" 
dolphin(31427) KSambaSharePrivate::add: We got some errors while running 'net usershare add' ("usershare", "add", "Descargas", "/home/emilio/Descargas", "", "Everyone:f,emilio:f", "guest_ok=y") 
dolphin(31427) KSambaSharePrivate::add: "net usershare add: cannot convert name "Everyone" to a SID. The connection was refused. Maybe smbd is not running.
" 
dolphin(31427)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(31427)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(31427)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(31427)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(31427)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
dolphin(31427)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:

Offline

#18 2012-11-18 16:48:20

ploub
Member
Registered: 2007-05-16
Posts: 132

Re: [SOLVED] Fail using Samba

This is my my smb.conf:

 workgroup = MSHOME
   server string = Samba Server
   security = share
   hosts allow = 192.168.1.  127.
   load printers = yes
   log file = /var/log/samba/%m.log
   max log size = 50
#============================ Share Definitions ==============================
[homes]
   comment = Home Directories
   browseable = yes
   writable = yes
        public = yes

[public]
   path = /mnt/data
   public = yes
#   only guest = yes
   writable = yes
   printable = no

[peter]
        path = /home/peter
        public = yes
#       only guest = yes
        writable = yes
        printable = no

Both shares show up in my media centre and no password is required. HTH

Offline

#19 2012-11-18 16:56:09

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

ploub wrote:

This is my my smb.conf:

 workgroup = MSHOME
   server string = Samba Server
   security = share
   hosts allow = 192.168.1.  127.
   load printers = yes
   log file = /var/log/samba/%m.log
   max log size = 50
#============================ Share Definitions ==============================
[homes]
   comment = Home Directories
   browseable = yes
   writable = yes
        public = yes

[public]
   path = /mnt/data
   public = yes
#   only guest = yes
   writable = yes
   printable = no

[peter]
        path = /home/peter
        public = yes
#       only guest = yes
        writable = yes
        printable = no

Both shares show up in my media centre and no password is required. HTH

Followed your advice, and modified my smb.conf like this

workgroup = WORK_GROUP
   server string = Samba Server
   security = share
   hosts allow = 192.168.1.  127.
   load printers = yes
   log file = /var/log/samba/%m.log
   max log size = 50
#============================ Share Definitions ==============================
[homes]
   comment = Home Directories
   browseable = yes
   writable = yes
        public = yes

[Datos]
   path = /home/emilio/Descargas
   public = yes
#   only guest = yes
   writable = yes
   printable = no

[HDD]
        path = /media/HDD
        public = yes
#       only guest = yes
        writable = yes
        printable = no

When I try to access I'm asked for user and password. I use guest with no password and I'm in, but the same problem, "no multimedia files on current folder"

Offline

#20 2012-11-18 16:56:41

shulamy
Member
From: israel
Registered: 2010-09-11
Posts: 453

Re: [SOLVED] Fail using Samba

are you sure the windows work group and host allaw is correct?

ezik

Offline

#21 2012-11-18 17:01:24

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

shulamy wrote:

are you sure the windows work group and host allaw is correct?

ezik

Windows work group? The WD has WORK_GROUP as work group, and WDAcapulco as the machine name (I've just seen that on the WD options)
About the host allow, I'm nearly sure that it's correct, all my ip's are 192.168.1.xx where xx depends on the connections (I use DHCP)

Offline

#22 2012-11-18 17:29:29

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

If I try to share the folder "Descargas" from thunar I get this error:
40651624.jpg
It's not a package error because I have thunar-shares-plugin 0.2.0-7 installed

I've found this

For non (X)ubuntu users the Samba setup is:
Create a group (must be done as root)

  export USERSHARES_DIR="/var/lib/samba/usershares"
  export USERSHARES_GROUP="sambashare"
  mkdir -p ${USERSHARES_DIR}
  groupadd ${USERSHARES_GROUP}
  chown root:${USERSHARES_GROUP} ${USERSHARES_DIR}
  chmod 01770 ${USERSHARES_DIR}

Use the following /etc/samba/smb.conf (or something similar)

  [global]
  workgroup = WORKGROUP
  security = share
  usershare path = /var/lib/samba/usershares
  usershare max shares = 100
  usershare allow guests = yes
  usershare owner only = yes

Add the samba group to your user (replace your_username by your login)

  usermod -a -G ${USERSHARES_GROUP} your_username

Restart Samba daemons

  /etc/init.d/samba restart

Logout and login your user (your_username)

May be the solution?

Last edited by eherranzr (2012-11-18 17:33:21)

Offline

#23 2012-11-18 18:02:32

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

New info!
I've tried to access to this shared folders from another PC (with Windows 7)connected to the same router.
I CAN access and without being asked for any user or password.
I can see 3 folders: Datos, hdd and homes:
If I try to access to hdd everything is ok. I can see all the files with no problem
If I try to access to Datos I get the following error:

Windoes can't obtain acces to \\192.168.1.35\Datos
You don't have permissions for obtaining access to \192.168.1.35\Datos.

These are the permissions for both folders:
drwxrwxrwx 119 emilio users  28672 nov 18 13:18 Datos
drwxrwxrwx 1 root   root  4096 nov 16 18:38 HDD

Any idea of what should I do? I think we're really close to solve the problem but I don't know how.

Instead, if I try to access from the samba machine, I open dolphin and I write in the direction bar smb://192.168.1.35/ and I'm asked for an user and a password, it doesn't matter what user I write (no password) that I'm in. If I try to access to HDD the same happens. But, if I try to acces Datos I'm asked for user and password again. No matter what I write (smb user + pass, system user + pass, root + pass, smb user no pass, system user no pass, root no pass) I can't access. Maybe something about permission?
Thanks to everybody. I feel really close to the solution

Thanks

Last edited by eherranzr (2012-11-18 18:09:40)

Offline

#24 2012-11-18 18:31:58

eherranzr
Member
Registered: 2011-06-28
Posts: 112

Re: [SOLVED] Fail using Samba

Yes! Yes!
Now, I've tried from the WD and with user anonymous and no pass I can access and see all films from the HDD folder, I just need now to see the ones from Datos folder.
This now should be easy shouldn't it?
Any help please?
Thanks

Offline

Board footer

Powered by FluxBB