Samba : setting up and tweaking

Hi all ;=)

i’m following the tips from Samba and Suse: HowTo Set up an openSUSE-Windows Home Office LAN/Network. Versions 10, 11 to set up samba and tweak it to my needs.

Could you please help me for a few questions ?

In my [global] section :

->i don’t understand why i haven’t got the 1st line (workgroup = …) , see my smb.conf (1) .
Where do i see the default name for the workgroup ?
Has it to be the same as in Windows ?

->Is netbios name important to set ?
is this the only place where to set it ?

->Is name resolve order important ?

Thanks :wink:

(1) the beginning of my smb.conf 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: 2009-06-24

[global]

printcap name = cups
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = Yes
usershare max shares = 100
usershare owner only = False

->i don’t understand why i haven’t got the 1st line (workgroup = …) , see my smb.conf (1) .
Where do i see the default name for the workgroup ?
Has it to be the same as in Windows ?

It must be the same as in windows. Just edit in in by opening the file in a text editor and typing in this:

workgroup = whatever_is_in_windows

You can open it with an editor with this command if using Gnome:

gnomesu gedit /etc/samba/smb.conf

or for KDE it’s

kdesu kwrite /etc/samba/smb.conf

->Is netbios name important to set ?
is this the only place where to set it ?

yes and yes. You can use other GUI devices to create the netbios name, but all of them just put it in [global] so you might as well use the easy GUI which is “kdesu kwrite” (or gnomesu gedit). as outlined above.

->Is name resolve order important ?
yes. Don’t use the default – it’s wrong for workgroups with windows, use this

name resolve order = bcast host lmhosts wins

Hello :wink:

Thanks for the precious tools on your site, i’ve been following them : “easy share”, lan primer.

The suse part is now ok but Windows untill now can’t see the linux shares. I think we need to create a local network with the wizards on windows.

From the ipp sharing method for printers i have another problem for the windows part :
I can’t add my local suse printer (HP psc 1210) in windows client as a network printer so far :

i can ping suse from windows, http:/opensuse111:631/printers works ok in windows’ firefox,
i installed the driver with the printer cd rom in windows, even plugged the printer to finish up some update for i’m using an old cd (win 98 and 2000) .

But when i’m trying to add the network printer i can’t see the right model : i have HP psc 1200 series and only 1500 & 1600 series are available .
In Windows the wizard shows a port 9100 as default, is it 9100 or 631 (?).
Shall i open some ports ?

At this point the “Have disk” option is unclear for me for i’m not quite sure what file i’m supposed to take from the cd rom (?)

The suse part is now ok but Windows untill now can’t see the linux shares. I think we need to create a local network with the wizards on windows.

Check that you have opened the firewall on openSUSE for Samba (or turn it off for the time being as a diagnostic test).
Please show us the contents of your file smb.conf

I’m confused about the printer. Is it attached to Linux machine or to windows machine?

Is this Windows XP or Vista?

Hi :wink:

About opening firewall for Samba :
i put my eth0 interface in the external zone, and added for it 2 services as mentionned (netbios server and samba server ; also cups for the ipp printer share).
Do i also need to open some ports for Samba ?

About the printer :
It’s a usb printer : Hp Psc 1210, it’s attached to the opensuse 11.1 desktop pc.

the client is a windows 7 version.

here’s the smb.conf :
[/codebox]

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: 2009-06-24

[global]

workgroup = WORKGROUP
netbios name = opensuse111
name resolve order = bcast host lmhosts wins

printcap name = cups
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = Yes
usershare max shares = 100
usershare owner only = False

local master = yes
preferred master = yes
os level = 65

[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
create mask = 0664
directory mask = 0775

[PARTAGE]
path = /home/fabrice/partage/
guest ok = yes
read only = no

[codebox/]

On Thu August 20 2009 01:06 pm, manchette fr wrote:

>
> Hi :wink:
>
> About opening firewall for Samba :
> i put my eth0 interface in the external zone, and added for it 2
> services as mentionned (netbios server and samba server ; also cups for
> the ipp printer share).
> Do i also need to open some ports for Samba ?
>
>
>
>
>
> About the printer :
> It’s a usb printer : Hp Psc 1210, it’s attached to the opensuse 11.1
> desktop pc.
>
> the client is a windows 7 version.
>
> here’s the smb.conf :
>
<snip>

manchette fr;

  1. While testing disable the firewalls on both SuSE and Windows, by default
    most 3rd party Windows firewalls disable Windows Networking.

These are the ports Samba needs to have open on your OpenSuSE box (and
Windows)
TCP: 135, 139, 445
UDP: 137,138

You also need to allow broadcasts.

  1. In order to access Samba shares you will need to add add Samba Users with

su
smbpasswd -a <username>

Where “username” is the name of a valid linux user.


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

Hi,

About broadcast :
i saw i gave the wrong network , mine goes with 192.168.0.x
(i had 192.168.1.x ), i changed it.

i opened the ports in suse, i did also in the router, still need to open the ports in windows firewall (it’s eset smart security firewall).

i’m afraid of disabling the firewall in windows, this os being targeted a lot by hackers …

http://tbn2.google.com/images?q=tbn:hYRi5NfatLmFAM:http://www.jungleredwriters.com/uploaded_images/GreatIdea-729283.jpg lol!

On Fri August 21 2009 11:26 am, manchette fr wrote:

>
> Hi,
<snip>
>
>
>
> i’m afraid of disabling the firewall in windows, this os being targeted
> a lot by hackers …
>

manchette fr;

Dropping the firewall for the few minutes it takes to test should not elevate
your risk to much. To be absolutely certain just disconnect your router’s
WAN port, or even use a hub/switch locally and bypass the router altogether.
If you are not connected to the Internet and your machines are clean there is
no need for a firewall.

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

Hi,
i agree about firewall in windows

i’m still fighting with this for i can’t find how to set up the local network in windows 7, it keeps not working when i try to enter the settings in the network configuration panes :expressionless:

for example in advanced settings i can’t let the radio button on the "activate network discovery " option , it comes back to opposite option (not discovering network) .

i changed some security feature in windows and now \linux_ip works and i have opensuse111 in the network of windows

From Linux untill windows i still can’t see windows pc :frowning:
When i use smb:/_windows_ip i have an id and password asked for access being allowed to windows seven.
What am i supposed to enter there ?
When i used the user and password of windows it does not work.

I have only one user in suse so far, do i have to create a specific user to be able to add it to samba for windows access ?
Do i also need to add this user in samba, specifically to access windows ?

On Tue August 25 2009 03:36 pm, manchette fr wrote:

>
> i changed some security feature in windows and now \linux_ip works and
> i have opensuse111 in the network of windows
>
>
>
> From Linux untill windows i still can’t see windows pc :frowning:
> When i use smb:/_windows_ip i have an id and password asked for access
> being allowed to windows seven.
> What am i supposed to enter there ?
> When i used the user and password of windows it does not work.
>
>
> I have only one user in suse so far, do i have to create a specific
> user to be able to add it to samba for windows access ?
> Do i also need to add this user in samba, specifically to access
> windows ?
>
>
manchette fr;

I have not tested with Windows7 and do not even plan to until SP1. There were
some changes made to Samba code for Windows7. So first install the most
recent version (3.3.4) available for opensuse. RPMs are available here:
ftp://ftp.suse.com/pub/projects/samba/3.0/

I’m not quite sure what you mean by “From Linux untill windows i still can’t
see windows pc”. Do you mean:
A. I cannot contact Windows 7 at all with "smb://ip/?
B. I can see the Windows 7 machine but not the shares?
C. I can see the Windows 7 machine and it’s shares, but am unable to access
the shares?


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

Hello ,

About updating samba :
shall i add the repo (# zypper ar ftp://ftp.suse.com/pub/projects/samba/3.0/11.1/suse-samba.repo ) to yast/zypper and then zypper ref && zypper up ?

Or do i only need a few rpms from ftp://ftp.suse.com/pub/projects/samba/3.0/11.1/i586/ ?

About trying to access windows from suse :
it’s the A solution : i’m supposed to enter an ID and password but it does not work.

From doplhin :

I do have samba shares showing my workgroup , in it i can see suse11.1 and seven (smb://workgroup/)
But then when i click on seven i have this :

http://img259.imageshack.us/img259/2888/sambafenetreautorisatio.th.png](http://img259.imageshack.us/i/sambafenetreautorisatio.png/)

I enter the ID and password used for windows but it is not working nor the root and password of suse.

I’m not sure what i’m supposed to enter there (?)

after upgrading samba i have a problem : shares are not available anymore in dolphin. No more suse, nor windows :frowning:

i saw that nmb daemon is not running but i can’t start it with yast gui (returning 7 : not running) , nor in console :

/etc/init.d/nmb status

Checking for Samba NMB daemon dead
opensuse111:/home/fabrice # /etc/init.d/nmb restart
Shutting down Samba NMB daemon Warning: daemon not running. done
Starting Samba NMB daemon - Warning: /var/run/samba/nmbd.pid exists. failed
opensuse111:/home/fabrice #

To remove a stuck pid run these:

sudo /etc/init.d/nmb stop
sudo /etc/init.d/smb stop
sudo rm /var/run/samba/nmbd.pid
sudo rm /var/run/samba/smbd.pid

Then try Yast’s runlevel editor to get them going again.

On Wed August 26 2009 03:26 am, manchette fr wrote:

>
> Hello ,
>
> About updating samba :
> shall i add the repo (# zypper ar
> ftp://ftp.suse.com/pub/projects/samba/3.0/11.1/suse-samba.repo ) to
> yast/zypper and then zypper ref && zypper up ?
>
> Or do i only need a few rpms from
> ftp://ftp.suse.com/pub/projects/samba/3.0/11.1/i586/ ?
>
>
> About trying to access windows from suse :
> it’s the A solution : i’m supposed to enter an ID and password but it
> does not work.
> I enter the ID and password used for windows.
> I’m not sure what i’m supposed to enter there :
>
> ‘[image:
> http://img259.imageshack.us/img259/2888/sambafenetreautorisatio.th.png]’
> (http://img259.imageshack.us/i/sambafenetreautorisatio.png/)
>
>

manchette fr;

  1. After Swerdna’s post were you able to start nmb? Did this change your
    situation any?

  2. It looks to me like you were contacting the Windows7 machine, but failing
    the login (B holds). The name/password you enter should be a valid Windows7
    username and password, you could try “guest” with a blank password. You
    may be required to adjust some Windows7 policy to allow guest logins. To
    eliminate any GUI problems in a terminal window try:


smbclient -L //<ip of Windows 7> -Uguest%

This should give a list of shares

At least for joining a Samba Domain the following keys must be changed
with “regedit”; I’m not sure about a simple work group but it would do no
harm to try:


HKLM\System\CCS\Services\LanmanWorkstation\Parameters
DWORD  DomainCompatibilityMode = 1
DWORD  DNSNameResolutionRequired = 0

HKLM\System\CCS\Services\Netlogon\Parameters
DWORD  RequireSignOnSeal = 0
DWORD  RequireStrongKey = 0

see:http://www.nabble.com/Windows-7-RC-td23405949.html
for the details.
P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Hi :wink:

After i apply Swerdna’s command lines i still can’t start nmb from Yast gui , it still returns 7 (not started) :frowning:

here’s what it gives from console :

~> sudo /etc/init.d/nmb stop
root’s password:
Shutting down Samba NMB daemon Warning: daemon not running. done
fabrice@opensuse111:~> sudo /etc/init.d/smb stop
Shutting down Samba SMB daemon Warning: daemon not running. done
fabrice@opensuse111:~> sudo rm /var/run/samba/nmbd.pid
fabrice@opensuse111:~> sudo rm /var/run/samba/smbd.pid
rm: ne peut enlever `/var/run/samba/smbd.pid’: Aucun fichier ou dossier de ce type

sudo /etc/init.d/nmb start
root’s password:
Starting Samba NMB daemon - Warning: /var/run/samba/nmbd.pid exists. failed
fabrice@opensuse111:~> sudo /etc/init.d/smb start
Starting Samba SMB daemon startproc: exit status of parent of /usr/sbin/smbd: 127
done

in linux i have this :
~> smbclient -L //192.168.0.12 -Uguest%
smbclient: symbol lookup error: smbclient: undefined symbol: _talloc_get_type_abort

in windows it tells me that it is not recognized as an internal command.

i changed the register of windows

here are samba rpms versions , i suspect different versions disturbing or something like that :
~> rpm -qa | grep samba
samba-3.4.0-11.1
samba-winbind-3.4.0-11.1
samba-client-3.4.0-11.1
samba-doc-3.4.0-4.1
samba-krb-printing-3.4.0-11.1
yast2-samba-client-2.17.11-1.30
yast2-samba-server-2.17.9-0.1.2
samba-devel-3.4.0-11.1
samba-debugsource-3.4.0-11.1
samba-debuginfo-3.4.0-11.1

On Thu August 27 2009 09:26 am, manchette fr wrote:

>
> Hi :wink:
>
> After i apply Swerdna’s command lines i still can’t start nmb from Yast
> gui , it still returns 7 (not started) :frowning:
>
> here’s what it gives from console :
>
> ~> sudo /etc/init.d/nmb stop
> root’s password:
> Shutting down Samba NMB daemon Warning: daemon not running.
>
>
> done
> fabrice@opensuse111:~> sudo /etc/init.d/smb stop
> Shutting down Samba SMB daemon Warning: daemon not running.
>
>
> done
> fabrice@opensuse111:~> sudo rm /var/run/samba/nmbd.pid
> fabrice@opensuse111:~> sudo rm /var/run/samba/smbd.pid
> rm: ne peut enlever `/var/run/samba/smbd.pid’: Aucun fichier ou dossier

de ce type

sudo /etc/init.d/nmb start
root’s password:
Starting Samba NMB daemon - Warning: /var/run/samba/nmbd.pid exists.

failed
fabrice@opensuse111:~> sudo /etc/init.d/smb start
Starting Samba SMB daemon startproc: exit status of parent of
/usr/sbin/smbd: 127

done

in linux i have this :
~> smbclient -L //192.168.0.12 -Uguest%
smbclient: symbol lookup error: smbclient: undefined symbol:
_talloc_get_type_abort

in windows it tells me that it is not recognized as an internal
command.

smbclient is strictly a “nix” command.

i changed the register of windows

here are samba rpms versions , i suspect different versions disturbing
or something like that :
~> rpm -qa | grep samba
samba-3.4.0-11.1
samba-winbind-3.4.0-11.1
samba-client-3.4.0-11.1
samba-doc-3.4.0-4.1
samba-krb-printing-3.4.0-11.1
yast2-samba-client-2.17.11-1.30
yast2-samba-server-2.17.9-0.1.2
samba-devel-3.4.0-11.1
samba-debugsource-3.4.0-11.1
samba-debuginfo-3.4.0-11.1

manchette fr;

With neither smbd or nmbd running there is no hope for Windows networking, so
it is no surprise that everything fails. This must be fixed first. From
the error in smbclient I suspect that you need to update libtalloc as well as
the ones shown above.

I’m not clear just how you updated but at this time let me suggest that you do
a manual install. First download all the rpm’s in the i586 directory(or
x86_64 if you are running X86_64 architecture) and the documents rpm in the
noarch directory. Save these in a directory that just contains these files.
In a terminal window do:


su
cd <path to directory containing the rpms>
rpm -Uvh *.rpm

(Do not try to force the install, if you run into dependencies they need to be
resolved.)

This should install all the new Samba rpms. Now try to start smb and nmb. If
Yast fails try in a terminal window:


su
rcsmb start
rcnmb start

If this fails, look in /var/log/samba/log.smbd; /var/log/samba/log.nmbd
and /var/log/messages and see if any information is provided. It may also be
necessary to clear the pid files ala Swerdna.

If you are absolutely unable to get a working copy of Samba 3.4 to work, your
only hope is to roll back to the release version and see if the registry
entries will get you going.

In any event once you have a working Samba, try the smbclient on Linux if
dolphin fails. This could be a problem with dolphin.

Just for clarity; did you disable Windows Firewall while you tested?


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

hi :wink:

i added another seven , the network is now :
opensuse111, seven, seven2.

i n fact i removed all the 3.4 samba rpms and went back to the previous version (3.2.7).

here’s what i have now :

1- seven can access linux easily, what i created, and default share profiles ; strangely groups share does not work

2- opensuse can’t access seven , despite using windows seven admin IDs
. i don’t get why . I haven’t tried without the firewall, i might try this 1st, and if it does not help it might then be a samba/seven issue (?)

3- seven2 can’t access seven , despite using windows seven admin IDs

4- seven can’t access seven2 but i still need to figure out the name and paswword of the root in seven2, plus the firewall possible issue.