Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
# Feburary 15, 2007
# This is my SAMBA configuration file, along with a lot of configuration tips and explanations
# The target configuration is for
# 1) a home networking setup using a Windows workgroup (as contrasted with a Windows domain),
with some number of boxes running Windows XP
# 2) with a single LINUX box with printers attached to it
# 3) the LINUX box functioning as a file and print server, using SAMBA and CUPS (Common Unix Printing System)
# 4) printer drivers installed on the XP boxes locally (not using LINUX box as source of XP drivers), so
# LINUX box gets sent "RAW" printer data (that is, native format for printer)
# 5) No authentication of users to access printers/shares, no software firewalls (I trust what I have in my router
# and the ISP also squelches everything but http packets)
# This configuration works, which I define as
# A) Other computers on the home network can read and write to shared files
# B) The LINUX box shows up in Network Neighborhood on Windows XP
# C) The shared files and printers show up in Network Neighborhood
# D) You can print from XP onto the printers attached to the LINUX box
# E) Using XP, you can see the print queues in the LINUX box
# I have notes at the end of this file for how other configurations might be accomplished
# I am running Fedora 6 version 2.6.19-1.2895 (do not know SAMBA and CUPS versions, but I suspect they are recent)
# In addition to this ssmb.conf file, you need
# w) To make sure that the printer software is installed on the LINUX box
# x) To deal with file permissions and SELINUX for the file share and print queue areas (see below)
# y) To make sure cups will know how to process "raw" printer data
# z) To make sure SAMBA/CUPS are installed and running
# (see below for all of this)
workgroup = Your_workgroup_name
netbios name = Your_LINUX_box_name
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
server string = Samba Server
security = share
guest ok = yes
guest account = samba_user
load printers = yes
cups options = raw
log file = /var/log/samba/%m.log
max log size = 50
domain logons = yes
wins support = yes
dns proxy = no
comment = All Printers
path = /var/spool/samba
browseable = yes
printable = yes
writeable = yes
printing = cups
printcap name = cups
printer admim = samba_user, root
disable spoolss = yes
show add printer wizard = no
use client driver = yes
comment = a shared area
path = /file_shares
writeable = yes
browseable = yes
create mask = 0777
# NOTES ON SOME OF THE CONFIGURATION DATA
# Load Printers parameter exposes to the network all printers defined on the system (I have all printers marked as "shared"
# - I am somewhat unclear as to whether this is necessary)
# The Wins proxy, DNS proxy and Domain Logons are recommended settings that I suspect have little impact on my target
# The log file parameter creates separate log files for each machine
# Printer admin is a parameter required for the print queues to be visible by the XP boxes (supposedly this parameter is
# due to be deprecated in upcoming SAMBA releases, but I have no clue as to how the replacement will work).
# I have mine off. Additionally both the CUPS and SAMBA servers can have Host Allow and Host Deny settings that
# permit you to screen out computers that should not have access (I do not have such setting in my configuration).
# WINDOWS PRINTER DRIVERS
# When you go to add a printer to the XP system, the Add Printer dialog will (hopefully) work.
# XP will try to find a driver (and in this configuration will not try to look on the LINUX box - see below for why)
# XP will try to see if the appropriate printer driver was previously installed in it, or if the correct driver
# was part of the Windows distribution files. Otherwise you will need the printer install CD.
# Installing an XP driver in this was will install software elements on the XP box which will create a binary stream
# ("raw" in this lingo) of data directly interpretable by the printer, it is this stream which get queued in the LINUX box.
# To have cups correctly process the raw data, you need
# a) a version of SAMBA with a direct interface to CUPS (recent versions have this)
# b) the cups options = raw line above
# c) the file /etc/cups/mime.type to have an uncommented line like "application/octet-stream"
# d) the file /etc/cups/mime.convs to have an uncommented line like
# application/octet-stream application/vnd.cups-raw 0 -
# FYI - the alternative (not used in this configuration) to the raw data streams is to have XP send an Enhanced MetaData print file which
# would get converted to raw by the LINUX box.
# The disable spoolss, use client driver and show add printer wizard options are configured this way as I am putting no XP
# printer drivers on the LINUX box (If you wanted to go in the opposite direction and have XP download the print drivers when
# needed from the LINUX box, you would need to set up a [PRINT$] file share and do a lot of configuration work. Good luck.
# SAMBA INSTALLATION
# My LINUX distribution did not install SAMBA. Using Terminal, YUM *SAMBA* did what I needed
# PERMISSION SCHEMES - (A) FILE PERSMISSIONS AND (B) SECURITY ENHANCED LINUX (SELINUX)
# You need to satisfy both of these schemes for both (a) the file shares storage and (b) the print queue storage
# Focussing first on the each of the file shares, you need
# i) to make the shared folder updatable by others - a permission string of 0777 will do this,or - if you are using the properties pane
# give "others" the "create and delete files" permission
# ii) to make sure the SELinux is not blocking access, you must either (x) disable SELinux, or (y) change the SELinux policy for
# the folder to permit other users access. For instance, the "root_t" policy - the default for folder at the top of the file system -
# works. Conversely, default policy for the /Home folder, or its subfolders, are the "User Home" or "User Data", and these do not work.
# iii) if there are files existing in the shared folders, you will want to make them updateable by others (same as (i) above)
# iv) the "create mask" parameter has the 0777 value in order to have files added by XP users created with an updateable status
# Now, focussing on the /var/spool/samba folder, you should (or so I read) fix the permissions and check the SELinux policy
# "samba_var_t" works for me
# LINUX USER ID
# I use a specific guest account (as opposed to the default "Nobody" user name) as various documentation warns about some
# incompatibilites with the default user name
# SAMBA runs under its own user id (and I have some recollection of confirming that some LINUX component knew that SAMBA
# was a trusted service)
# WINDOWS DOMAINS (AS OPPOSED TO WORKGROUPS)
# If you want to use a Domain Controller (in an XP box, or one running on the LINUX box), you have a lot of configuration work to do.
# Good luck
# HOME DIRECTORIES
# This configuration does not have the setup somewhat customary to small enterprise configurations, where users log in to
# their Windows machines, and their log-in names and passwords are used to select and validate their access to specific
# file shares or printers. You may see examples of this in the [HOMES] section of various other sample smb.conf files.
# These configurations generally run with the Security parameter set to the value of USER as opposed to SHARE.
To print to a Windows-hosted printer from a LINUX box, you can try following which worked for me.
I run Fedora6 and use the GUI, so you may have a different process to deal with -
1) Install SAMBA (yum *samba*)
2) Configure samba.conf as described above (actually, you have not need to do much more than type the workgroup name in)
3) Using the Fedora6 GUI, go to Systems, Administration, Printing and push the New Printer button
4) This will bring up the New Printer Wizard, the first screen of which just gets the name you want to assign and descriptive text
5) Hit Forward (and be prepared to wait for a while)
6) Select "Windows Printer via SAMBA"
7) I cannot get the Browse function to work, but I can type in the workgroup_name/computer_name/shared_printer_name
8) Hit foward again, and get a driver installed by selecting manufacturer and then model number