Top 10 Downloads
  Last 15 New Files
  Web Links
  Last 15 New Tips
  NLM Programming
  Admins Club

SUPLA System
Internet of Things

Installation and Administration

Polish Forum SUSE

Who's Online

 There are currently,
5 guest(s)
that is (are) online.

Technical Information

Back to List of Categories

Technical Information about
  A Little YaST Magic
  A Slideshow for Your KDE Wallpaper
  Add Novell Support to Your Firefox Search Engine
  Adding To The Panels In Gnome.
  Akregator - RSS News Reader
  An Introduction to WBEM and OpenWBEM in SUSE LINUX
  Authenticating SUSE LINUX to eDirectory via LDAP
  Basic Mounting Differences between Windows and Linux
  Beginner's Guide to Using Novell SUSE LINUX's Build Utility
  Browsing Files
  Card Readers on SUSE LINUX 9.2 Professional?
  Changing the Default Browser in Gnome
  Developing Perl CGI scripts on SUSE LINUX
  Do I Have Permission?
  Double SYNC -- Using RSYNC Simultaneously With and Without Branch Office for Data Backup
  Dumb Question: Mounting Linux CDs
  Easy Command-Line Introduction
  Easy Way to Debug SSL Connections
  Enabling an Interactive Startup in Novell/SUSE LINUX
  Exploring MySQL 4.1 and PHP 5 on SUSE LINUX
  Extend Your Panels Using Gnome Drawers.
  Firefox Speed Tip
  Fix Java Errors With ConsoleOne On Linux
  Fix Your Mouse Wheel...
  Gimp -- Closing In on Photoshop...
  Gimp Tips Part 1: Resizing Images
  Gimp Tips Part 2: Rounding Corners
  Gimp Tips Part 3: Fading Photography Edges
  Gimp Tips Part 4: Selective Colorization
  Gimp Tips Part 5: Plugins a Plenty - Adding Light
  Gimp Tips Part 6: Using The Clone Tool
  Google Auto-fill Replica for Linux
  How a Corrupted USB Drive Was Saved by GNU/Linux
  How to Implement Login Scripts into a Pure Linux Environment
  How to install and connect an External Modem on a Linux PC
  How to Install the Novell Client for Linux on SUSE Linux 10.0
  How to launch applications at login in Gnome
  How to Remote Control Linux
  How to setup a Linux application to automatically startup when you login.
  How to share Files and Printers Between Linux and MS Windows with Samba
  How to uninstall the Novell Client for Linux
  How to upgrade the Novell Client for Linux
  How to use SMB without turning off the firewall
  How's the Weather?
  HTML Development Tools in Linux
  Informative Bash Prompt
  Install and Use QEMU on SUSE 9.2
  Install Linux Frequently, Without the Hassle
  Installing Apache, PHP, and MySQL on SUSE LINUX Professional
  Installing RPM Files
  Integrating Novell Linux Desktop into a Novell NetWare network
  Introduction to Oracle 10g R1 ( on SUSE LINUX Professional 9.3
  iPrint Printers on Novell Linux Desktop
  Linux Scheduling Priorities Explained
  Make a Misbehaving Program Quit
  Manually Mounting a USB Flash Drive in Linux
  Migrating To Linux, Advantages Over Windows 9.x And XP
  Minimize Your Maximizing with Multiple Desktops
  Mounting NetWare Volumes On NLD Illustrated
  Move Your /home to Another Computer
  Mozilla Mail Review
  Need a Backup?
  Novell Client Settings with Windows Terminal Server
  Novell Linux Desktop Equivalents of Windows Software - New and Improved
  Novell Linux Desktop System Upgrade How-To
  Partitioning Hard Drive for Linux Install
  Perform Remote SuSE Installations With Virtual Network Computing
  Quick Intro to Klipper
  Quick Shortcuts in The Gimp
  Reset Your Lost Root Password
  Resizing Your Gnome / KDE Panels
  Runlevels in SUSE LINUX
  Running Existing Win32 Applications on SUSE LINUX
  Service Command in /etc/init.d/
  Setting Shortcut Keys
  Setting up a Linux NFS Install Source for Your LAN
  Should I choose Novell Linux Desktop or SUSE LINUX Professional as my desktop?
  Starting Services From the Command Line On SuSE LINUX
  Sticky Notes for Gnome
  SUSE LINUX 9.3 Professional Review
  Sync Up The Taskbar and the Desktop in Gnome
  System Upgrade How-To
  Taking Screenshots in Linux
  The Basics of Messaging in the Cross-Platform GroupWise Client
  The Novell Client for Linux (beta).
  Transparent Panels in Gnome
  Trick Out Your KDE Desktop
  Understanding the YAST Software Module Options
  Updating Your Software with Red Carpet
  Using dsbk on Linux and Unix
  Using iFolder to Synchronize Firefox Bookmarks
  Using Multiple Swap Partitions In 2.4
  Using openSSH to Securely Access Remote Systems
  What FTP client should I use on Linux?
  What Is Logical Volume Management?
  What is so great about Firefox?
  Which Graphic Formats For What?
  Windows Shortcuts for Firefox Tabs on Linux
  Windows to Linux: A Beginner's Guide
  Windows Users Can Feel at Home Exploring Files in Linux
  WLAN interface as the Default
  Work With User Selection Icons In KDM
  YAST Online Update De-Mystified

Technical Information
 How to share Files and Printers Between Linux and MS Windows with Samba

Printer-friendly version

13 Jan 2005

These instructions presume you have all the necessary software installed on your Linux box and have working network cards on each box. Linux software required is CUPS, SAMBA and Webmin. The printer is set up on the MS windows box.

You will probably have CUPS and SAMBA in your distribution, but you might not have Webmin. You can get it from the web. Download the file suitable for your distribution. Once it is installed, usually in /usr/libexec/webmin cd to that directory and run the script ./setup.sh You can press enter for most of the prompts. Use root and root's password for the administrator unless you have an admin user. Webmin uses Perl, so you must have this installed before you try to set Webmin up.

Make sure CUPS and SAMBA are installed and able to run on your Linux box. You can check if they are available and marked for run on boot through Yast – Run Level Editor on Suse or by using setup – system services in a terminal on RedHat. Other distributions you will find help in the documentation, but the start up scripts can be found in /etc/init.d and the run level services are often links to these scripts in /etc/rc.d/rc.RunLevelNumber or /etc/rc.RunLevelNumber. Whatever your system, just make sure they are marked for run at boot and start them running now.

You need A WORKING CONNECTION between the Linux box and the MS Windows box. This is basic stuff and not covered here except to say that in simple networking the IP addresses must be on the same network. (There is plenty of help on this especially in the Linux How Tos which are available on the Web. Look at Ethernet Networking to start.)
ie or etc., otherwise you won't get a connection.

For this example, I will use for the MS Windows box and for the Linux box.
The host names will be "swine" and "pearl" respectively.
The workgroup name will be SWINET.
Enable print and file sharing on "swine". You will have to perform the annoying MS reboot.
After plugging in the network cabling, check the connections at each box with the command
ping in a DOS prompt window on MS, and ping -c 5 in shell terminal on Linux.

Presuming you got this far there are some important mandatory factors to get a SAMBA connection working. It's all in the passwords, plus a bit of setup in the correct order.

In MS Windows - Make a new user or use settings/control panel/passwords to create an MS windows user with a password.

EG user name = stomfi
password = 2mcStb
Note the user name is all lower case. The password is more or less the first letters of "Too many cooks Spoil the broth". A great way of thinking up hard to crack easy to remember passwords.
Make sure the Windows work group is set to SWINET do this in Right Click NetworkNeighborhood properties.

On Linux - Make an account on Linux for your windows login name making sure you give it the same password as your windows one.

EG stomfi & 2mcStb

On Linux - as root - use the samba password shell command which will prompt for the password:

smbpasswd -a stomfi

Now set up the SAMBA config file by copying the text delineated by ######### below into your editor and save the file into /etc/samba/smb.conf. Don't use a word processor because they can put hidden characters in your file which may prevent it running properly.

There are plenty of comments in this file which I have left just in case you need these features. Comment lines begin with a semi colon

; /etc/samba/smb.conf 
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
; This is the file that stomfi is using to connect a hard drive based 
; Linux system to a windows box with windows printer 
; See the Winprint instructions below for how to set up the printer using 
; Webmin and Cups 
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 
 printing = cups 
 printcap name = cups 
 guest account = nobody 
 invalid users = root 
; "security = user" is always a good idea. This will require a Unix account 
; in this server for every user accessing the server. 
 security = user 
; Change this for the workgroup your Samba server will be part of 
 workgroup = SWINET 
 server string = %h server (Samba %v) 
; If you want Samba to log though syslog only then set the following 
; parameter to 'yes'. Please note that logging through syslog in 
; Samba is still experimental. 
 syslog only = no 
; We want Samba to log a minimum amount of information to syslog. Everything 
; should go to /var/log/{smb,nmb} instead. If you want to log through 
; syslog you should set the following parameter to something higher. 
 syslog = 0; 
; This socket options really speed up Samba under Linux, according to my 
; own tests. 
; Passwords are encrypted by default. This way Windows 9x and NT 
; clients can connect to the Samba server with no problems. 
 encrypt passwords = true 
 passdb backend = smbpasswd guest 
; It's always a good idea to use a WINS server. If you want this server 
; to be the WINS server for your network change the following parameter 
; to "yes". Otherwise leave it as "no" and specify your WINS server 
; below (note: only one Samba server can be the WINS server). 
; Read BROWSING.txt for more details in your Samba docs. 
 wins support = yes 
; If this server is not the WINS server then specify who is it and uncomment 
; next line. 
; wins server = 
# If we receive WINS server info from DHCP, override the options above. 
; include = /etc/samba/dhcp.conf 
; Please read BROWSING.txt and set the next four parameters according 
; to your network setup. There is no valid default so they are commented 
; out except for the local master here. 
; os level = 0 
; domain master = no 
 local master = yes 
; preferred master = 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 
; This will prevent nmbd to search for NetBIOS names through DNS. 
 dns proxy = no 
; Name mangling options 
 preserve case = yes 
 short preserve case = yes 
; This boolean parameter controls whether Samba attempts to sync. the Unix 
; password with the SMB password when the encrypted SMB password in the 
; /etc/samba/smbpasswd file is changed. 
 unix password sync = true 
; For Unix password sync. to work on a  GNU/Linux system, the following 
; parameters must be set (thanks to Augustin Luton 
;  for sending the correct chat script for 
; the passwd program in Debian Potato). 
 passwd program = /usr/bin/passwd %u 
 passwd chat = *EntersnewsUNIXspassword:* %n
 *RetypesnewsUNIXspassword:* %n
; The default maximum log file size is 5 MBytes. That's too big so this 
; next parameter sets it to 1 MByte. Currently, Samba rotates log 
; files ( eg /var/log/{smb,nmb} ) when these files reach 1000 KBytes. 
; A better solution would be to have Samba rotate the log file upon 
; reception of a signal, but for now on, we have to live with this. 
 max log size = 1000 
 obey pam restrictions = yes 
; Some defaults for winbind (make sure you're not using the ranges 
; for something else.) 
; winbind uid = 10000-20000 
; winbind gid = 10000-20000 
; template shell = /bin/bash 
; ISOLATIN1 with euro sign 
unix charset = iso-8859-15 
display charset = iso-8859-15 
dos charset = 850 
 comment = Home Directories 
 browseable = no 
; By default, the home directories are exported read only. Change next 
; parameter to "no" if you want to be able to write to them.  Not a good idea.
 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 
 printer = MSwinPrinter1 ; what we will call our MS printer 
 browseable = no 
 printable = yes 
 writable = no 
 path = /var/spool/cups 
 comment = All Printers 
 public = no 
 create mode = 0700 
 comment = User Public rw 
 browseable = yes 
 path = /usr/public 
 printable = no 
 public = yes 
 writable = yes 
 create mode = 0770 
; A sample share for sharing your CD-ROM with others. 
 comment = Samba server's CD-ROM 
 writable = no 
 locking = no 
 path = /mnt/cdrom 
 public = yes 
; The next two parameters show how to auto-mount a CD-ROM when the 
; cdrom share is accessed. 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 
Don't forget to save the file into /etc/samba/smb.conf
or where ever it goes on your distribution
Restart the samba server with Yast – run level editor – expert mode – restart or the redhat command service smb restart from a terminal
or by going to the directory /etc/init.d and running the SAMBA startup file from there
eg ./samba restart or similarly /etc/init.d/samba restart
you can always grep for samba in a terminal to find out your initialisation file name
grep samba /etc/init.d/*

Make sure you set the /usr/public directory for open access

mkdir /usr/public
chmod a+wrx /usr/public

Now logon to your Windows box using the name and password you created

EG stomfi 2mcStb

Double click Network Neighborhood
Double click the hostname of your Linux box
Use the same password

EG 2mcStb

If you followed these instructions so far you should now be able to access the Linux box. Try writing and saving a file to the public share on the Linux box

Now for the Printer which should already be going on the "swine" box.
On "swine" click on Settings/Printers and right click the printer you want to share. Click "sharing" and click "shared as" and give it a share name

EG "hp"
Open the NetworkNeighborhood Icon
Click on the local Machine Name EG swine
Click on the Printer and write down the share name exactly as MS records it
EG Swinehp

Now for Linux
Unlike older Linux network printing using LPD where the client connection sends a raw print file to be processed on the print server, Linux Cups to MS windows Samba printers uses the client printer driver. This had me stymied for about 10 minutes, until I hacked the solution.

(To Hack: To discover and apply a clever way of solving a problem. Something easily done on Linux, with all those lovely tools for dumb users like me, but not so easy on MS Windows. At least I can't figure out how to).

On Linux
Fire up Webmin in your favourite browser by the address:

EG http://pearl:10000

Enter your webmin admin user name and password

EG root TAB wtJaHaNd ENTER

Click the Hardware Icon along the Webmin top bar
Click Printer Administration
Click Add new printer

In the Printer Configuration Panel
Enter a name

EG MSwinPrinter1
Enter description
EG MS Windows Laser Printer

Leave the rest as is unless you need this as the default printer.

In the Printer Description Panel Click Remote Windows server
Enter the MS windows Machine Name

EG Swine
Enter the Printer Name
EG hp
At the bottom Click on Create
Return to Printer Admin and you will see your newly created printer with none in the Driver column.

Click on the Servers Icon
Click on Samba Windows File Sharing
Click on Restart Samba Servers at the bottom of the page.

Now put the address for cups in the browser address

EG http://pearl:631
Click on Printers on header bar
Your new Printer will be shown with the Name MSwinPrinter1 and Local Raw Printer
The Device URL will be smb://Swine/hp
Click on Modify Printer under the above line
Click Continue - Modify Printer MSwinPrinter1
Click Continue - The Device - Windows Printer via SAMBA
Click Continue - Device URL
Click Continue - Model/Driver - This is what we will change
Our example Model is an HP and the Driver is for a LaserJet
Click HP
Click Continue - Model/Driver
Click HP LaserJet Series CUPS v1.1(en) - (For the CUPS version I am using) - Back to Admin
Click MSwinPrinter1 - Shows page for MSwinPrinter1
Click Print Test Page
Click On the Job ID and you should see positive messages like
Printer state accepting jobs
CUPS v 1.1 is ready to print

If the Test page is no good go back and Modify Printer again using a different Driver. If you have Gimp Print installed these may be the best drivers.

This is the end of these hopefully simple tips and tricks for getting a working SAMBA file sharing and Windows printing.

You will notice I didn't mention using LinNeighborhood.
You can try this in Linux but don't forget to set up the options to open up the mounted share with the file manager. This uses that other wonderful Linux tool "Midnight Commander". I should be doing a HowTo on using MC for end users soon, so look for this as it can save you a lot of running around looking for the right file utilities.

Since 2003

Portal posiada akceptację firmy Novell Polska
Wszystkie materiały dotyczące produktów firmy Novell umieszczono za zgodą Novell Polska
Portal has been accepted by the Novell Polska
All materials concerning products of Novell firm are placed with Novell Polska consent.
NetWare is a registered trademark of Novell Inc. in the United States and other countries.
Windows is a trademark or a registered trademark of Microsoft Corporation in the United States and other countries.
Sybase is a registered trademark of Sybase Inc. in the United States of America.
Other company and product names are trademarks or registered trademarks of their respective owners.