LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   Samba - Swat - Suse 10.2 Howto (https://www.linuxquestions.org/questions/suse-opensuse-60/samba-swat-suse-10-2-howto-567371/)

jdmcdaniel3 07-07-2007 09:02 AM

Samba - Swat - Suse 10.2 Howto
 
Samba Setup How-To in SuSE 10.2

Date: July 7, 2007
By: James D. McDaniel – Austin, TX

OVERVIEW

I thought I would write up detailed instructions on how I setup Samba to work between Linux and Windows computers. This procedure has worked for me since SuSE 10.0 and including SLED 10 SP1. While SuSE includes some Samba functions in YaST, the best way to control Samba is using SWAT, an HTML page you can access from Firefox in Linux. I will detail how to install, configure and use Samba in SuSE 10.2, but this can be used with little change to most versions of SuSE since 10.0.

LOOKFIRST

Before you setup Samba on your system, here is something to consider. When you installed your copy of Linux, you were required to supply a network Hostname and Domain Name for your network device. Do Not Use these same names when you configure Samba. Very strange things can happen to your SMB shares. You can look at what you entered for your network device using the following commands. Either do not use these names in Samba or change the names you setup here so you can use this name in Samba.

Select: YaST/Network Devices/Network Card/Edit (Active Network Device)

Select: /Hostname and Server Name/Accept

Hostname: xxxxxxxx Domain Name: yyyyyyyy

UPDATE SAMBA

It is best that before we start using Samba, we have the most recent version installed on our Linux system. Here are the instructions to use to perform that task.

Select: YaST/Software/Installation Source

Add The Following (HTTP) Installation Source...

Server Name: us1.samba.org
Directory on Server: /samba/ftp/Binary_Packages/SuSE/3.0/10.2/

Once the Installation Source has been successfully added, now you need to update your version of Samba.

Select: YaST/Software/Software Management

Search for Samba & cifs and update/Install all samba files shown. Normally, you would have Samba files installed except for the document file and so you will just update the correct version for your system, 32 or 64 bit and then elect to install the Samba Document file. You want the document file when you run the SWAT utility.

Select: Finish

MODIFY SERVICE CONFIGURATION FILES

Next we need to modify some configuration files so that Samba and SWAT run services can be activated. You will need to start a terminal session, do a SU command, enter the root password and then use the VI editor to edit these three files. Or, you can run the File Manager in Super User Mode, enter the root password and then navigate to the /etc/xinetd.d folder and use your favorite text editor to edit these files. I use the latter method, but you do it the way you prefer. In each file you will change disable=yes to disable=no and remark out the line only_from = 127.0.0.1 by placing a # symbol in front of the line.

Folder Location: /etc/xinetd.d

Edit Servers File:

# default: off
# description: An internal xinetd service, listing active servers.

service servers
{
type = INTERNAL UNLISTED
port = 9099
socket_type = stream
protocol = tcp
wait = no
disable = no
# only_from = 127.0.0.1
FLAGS = IPv6 Ipv4

Edit Services File:

# default: off
# description: An internal xinetd service, listing active services.

service services
{
type = INTERNAL UNLISTED
port = 9098
socket_type = stream
protocol = tcp
wait = no
disable = no
# only_from = 127.0.0.1
FLAGS = IPv6 Ipv4

Edit SWAT File:

# SWAT is the Samba Web Administration Tool.
service swat
{
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/sbin/swat
# only_from = 127.0.0.1
log_on_failure += USERID
disable = no

ACTIVATE RUN SERVICES

Now we need to activate four runlevel services in YaST. Perform the following tasks in YaST:

Select: YaST/System/System Service (Runlevel)/Expert Mode

Highlight each of the four following services with your mouse and perform the following two tasks on each service. I start from the bottom of the service list and work going up the list:

Select: Set/Reset – Enable the Service
Select: Start/Stop/Refresh – Start Now

xinetd
winbind
smb
nmb

Select: Finish

This saves your selections and starts the required services.

USE SWAT to CONFIGURE SAMBA

Now we are ready to start configuring Samba for use on your Linux system. I normally add an icon on my desktop to access SWAT. ON your desktop, perform the following task:

Right Click on Desktop and select Create New/Link to Application

Enter the name “SWAT” in place of “Link to Application”. Press the icon button next to the name and search for Samba and pick one of the icons that relates to Samba. Next pick the Application tab and enter the following command into the Command Line, “firefox localhost:901” and then press OK to save your entries. It seems like I had to use “firefox 127.0.0.1:901” in one version of SLED depending on your security settings.

If all of the instructions have worked to this point, you should be able to start SWAT by selecting your new desktop icon. When SWAT first starts, you must enter the root name and root password. You can optionally elect to save these names for future use which is how I do it. If you have the SuSE firewall enabled, you are going to have to add some things to get Samba to work, but I normally just run with the firewall off.

When SWAT starts, you should be at the Home location where you can read about all of the Samba parameters which can be very helpful. Pick the globals button at the top to setup your workgroup name and netbios or computer name. The shares button allows you to setup your local shares and the printer button allows you to share your printers. Samba is a very flexible application and its total configuration is beyond the scope of this document. However, I am including a copy of my smb.conf file for your review. I normally have a dual boot system and I share a common software folder and my Windows folder. I have a device driver loaded that allows you to write to a NTFS partition, which you may not have installed. I do not share any printers, but you may wish to do so. For the entry guest account=, I actually created a user called guest and gave them a password. If you use my same file, then you must do the same thing. Here is my Samba configuration file:

Folder Location: /etc/samba

File Name: smb.conf

# Samba config file created using SWAT
# from 127.0.0.1 (127.0.0.1)
# Date: 2007/05/30 20:41:20

[global]
workgroup = WINDOWSNT
netbios name = LINUXMASTER
server string =
security = SHARE
map to guest = Bad User
guest account = guest
printcap name = cups
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
logon path = \\%L\profiles\.msprofile
logon drive = P:
logon home = \\%L\%U\.9xprofile
local master = No
domain master = No
idmap uid = 10000-20000
idmap gid = 10000-20000
hosts allow = 192.168.0.0/255/255/255.0, 127.0.0.1
hosts deny = ALL
cups options = raw
include = /etc/samba/dhcp.conf

[software]
comment = Primary Software Storage
path = /Software
read only = No
guest ok = Yes

[windows]
comment = Windows Partition
path = /Windows
read only = No
guest ok = Yes

SETUP DESKTOP ICON to WORKGROUP

Right Click on Desktop and select Create New/Link to Location (URL)

Use your Workgroup name for the “filename” entry. Enter “smb:/workgroup” for the “Link to Location (URL)” where workgroup is replaced by the name you selected for YOUR workgroup name. Press OK to save your entries. Right click on the new desktop icon and pick properties. Press the icon button next to the name and search for Samba and pick one of the icons that relates to Samba. You now have two new icons on your desktop, one that starts SWAT to configure Samba and one to go directly to your workgroup.

CONCLUSION


As of this writing, I have found that Samba version 3.0.25b-0.68-1378-SUSE-SL10.2 to work like a champ between other Samba copies running on Linux and to Windows XP and Windows Vista workstations. Samba is a super flexible program that has many configurations. To learn more about Samba I suggest you visit the web site samba.org and see whats going on.

If you have any problems or issues with these instructions, please let me know.

Thank You,

J.W. 07-07-2007 08:54 PM

Great write-up. Please consider submitting this as a Linux Tutorial. Regular forum posts drop off the front page of threads as they age, whereas tutorials are always visible. Thanks

jdmcdaniel3 07-07-2007 11:18 PM

Thank You
 
Thanks for your kind comments. I did a post to the area you pointed to. I am not sure if it went through or not as I have not done this before. If I don't hear anything, I will try again.

Thank You,


All times are GMT -5. The time now is 05:22 PM.