0% found this document useful (0 votes)
86 views

Samba Server Step by Step

The document discusses configuring a Samba server using SWAT (Samba Web Administration Tool). It describes SWAT as a web-based tool for configuring the Samba server configuration file (smb.conf). It provides instructions for installing SWAT, starting the SWAT service, and accessing SWAT using a web browser to configure file sharing, printing sharing, and user authentication on the Samba server.

Uploaded by

hoodadada
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views

Samba Server Step by Step

The document discusses configuring a Samba server using SWAT (Samba Web Administration Tool). It describes SWAT as a web-based tool for configuring the Samba server configuration file (smb.conf). It provides instructions for installing SWAT, starting the SWAT service, and accessing SWAT using a web browser to configure file sharing, printing sharing, and user authentication on the Samba server.

Uploaded by

hoodadada
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Samba Serve r Step by Step

1. In t r o d u c t i o n 1.1 What Samba i s ? 1.2 What Samba can do? 1.3 Dif f e r e n t componen t s of Samba se r v e r su i t . 1.3.1 Samba se r v e r s cor e componen t s - smbd & nmbd . 1.3.2 Samba se r v e r conf i g u r a t i o n f i l e (smb.conf). 1.3.3 Ut i l i t i e s fo r samba se r v e r . 1.4 Conf i g u r i n g Samba se r v e r us i ng - swa t 1.4.1 What i s swa t ? 1.4.2 How to s t a r t swat se r v i c e s ? 1.4.3 Conf i gu r i n g Samba se r v e r s GLOBALS sec t i o n (smb.conf) 1.4.4 Cra t i n g Samba Password da t a b a s e 1.4.4.1 How to add new use r to Samba pas sword da t ab a s e ? 1.4.5 Cra t i n g sha r ed re cou r s e 1.4.5.1 Shar i n g Serve r s CDROM Drive 1.4.6 Sta r t i n g smbd & nmbd demons 1.4.7 Samba se r v e r in Act i on 1.5 Shar i n g Pr i n t e r s 1.5.1 Pr i n t e r i s connec t e d to Anothe r Windows Sys t em 1.5.2 Pr i n t e r i s connec t e d to Linux Serve r i t s e l f 1.6 Resou r c e s

1 In t r o duc t i o n
Most of th e ne twork s bas i c use i s f i l e s & pr i n t e r sha r i n g. Gener a l l y in windows ne twork i n g we have MS-DOS, MS-Windows 95/98 as c l i e n t s machine and Windows NT as se r v e r , toge t h e r they fo rms Microso f t windows NT ne twork.

Fig.1 : Microso f t

Windows Network i ng Se tup

But when we would l i k e to use Linux as se r v e r and windows 95/98 as c l i e n t s us i ng Micro so f t windows NT l i k e ne twor k we need to use spec i a l prog r am to emula t e Windows NT on top of Linux se r v e r , th i s can be done us i ng Samba. Thi s i s requ i r e d becaus e windows and Linux can not exchange the da t a di r e c t l y . In th e most of th e ne twork env i r o nmen t we use di f f e r e n t oper a t i n g sys t em fo r ver i t y of works and most of us need to sha r e our f i l e and pr i n t e r s f r om di f f e r e n t works t a t i o n s l i k e MAC, Linux, Micro so f t Windows 9x/Me/XP/NT/DOS, OS/2, Novel e t c. Thi s par t of documen t shows you how to con f i g u r e samba se r v e r us i n g swat - web admin i s t r a t i o n too l fo r Micros o f t Windows 9x/XP/NT Os.

1.1 What Samba i s ?


Samba se r v e r i s Linux ' s impl emen t a t i o n of Micro so f t ' s Windows NT f i l e & pr i n t se r v e r . I f you want to use f r e e Fi l e & Pr i n t se r v e r fo r your Windows 9x Cl i e n t th en i t s good cho i c e. Samba uses the SMB (Serve r Message Block) pro t o c o l , which i s used by Windows NT.

1.2 What Samba can do?

You can sha r e f i l e s & fo l d e r s be tween Linux and re s t of windows c l i e n t s inc l u d i n g windows NT Serve r/Works t a t i o n . Shar i n g of Pr i n t e r s a t t a c h e d to Linux se r v e r or any of the windows c l i e n t compute r . Authen t i c a t i o n (l i k e Windows NT Domain se r v e r ) fo r windows c l i e n t s .

1.3 Dif f e r e n t component s of Samba se r v e r su i t


Samba se r v e r i t s e l f

div i d e d in t o di f f e r e n t

prog r ams l i k e

Core componen t s of samba (smbd & nmbd). Samba conf i g u r a t i o n f i l e (smb.conf). Uti l i t i e s fo r samba se r v e r .

Documenta t i o n fo r samba.

Let s look a t them s t e p by s t e p:

1.3.1 Samba se rv e r s core component s:


(a) smbd daemon : I t s i s th e se r v e r daemon, which i s used fo r :

Fi l e s & fo l d e r sha r i n g

Pr i n t i n g sha r i n g User au t h en t i c a t i o n con f i g u r a t i o n f i l e ca l l e d

smbd can be con t r o l l e d us i ng spec i a l smb.conf. (b) nmbd daemon :

I f you eve r used windows l i k e ne twork th en you ar e fami l i a r with Network Neighborhood which i s used to see a l l compute r connec t e d to your ne two rk. nmbd daemon i s used to show Linux se r v e r (Samba Serve r) in t o your Network Neighborhood ' s browse r l i s t . I t s a l s o know as NetBIOS namese r v e r which prov i d e s naming se r v i c e s to i t s c l i e n t comput e r . Withou t th i s you can ' t see Samba se r v e r in t o Network Neighborhood . TIP: You can s t a r t / s t op above daemon f r om /et c/r c.d/ in i t . d/ smb sc r i p t . For e.g. To s t a r t the samba daemon type th e command / e t c/r c.d/ in i t . d/ smb s t a r t on your t e rm i n a l .

1.3.2 Samba se rv e r con f i g u r a t i o n f i l e (smb.conf)


"smb.conf " i s the main Samba se r v e r conf i g u r a t i o n f i l e . Thi s f i l e div i d e d in t o di f f e r e n t sec t i o n s , most of the sec t i o n desc r i b e s the sha r e d re s ou r c e s l i k e CDROM dr i v e, Pr i n t e r e t c. In orde r to use your samba se r v e r you need to ed i t and conf i g u r e th i s f i l e . But smb.con f f i l e can be con f i g u r e d and admin i s t e r e d by the swa t prog r am. Swat run s f r om any web browse r.

1.3.3 Ut i l i t i e s

fo r samba se r v e r

Thi s i s th e se t of ut i l i t i e s which can be used to browse windows sha r e f r om Linux or to di agno s e Samba conf i g u r a t i o n er r o r s . Fol l ow i ng are some of the ut i l i t i e s :

smbpas swd - Use to manage samba se r v e r s pas sword. t e s t p a rm - Use to t e s t smb.conf con f i g u r a t i o n f i l e . I t check s the par ame t e r s in smb.con f f i l e . t e s t p r n s - Use to t e s t pr i n t e r con f i g u r a t i o n . smbcl i e n t - To open windows sha r e f r om Linux se r v e r i.e. SMB cl i en t. smbta r - I t s prog r am to backup the f i l e s f r om any windows cl i en t.

1.4 Conf i g u r i n g Samba Serve r us i ng swat


As ment i o n ed ear l i e r , we are going to use swat to conf i g u r e th e samba se r v e r . Swat i s the par t of samba di s t r i b u t i o n . But by def au l t swat i s no t in s t a l l e d on Red Hat Linux 7.3, in orde r to in s t a l l swat you need to put Red Hat Linux In s t a l l a t i o n CD No. 3 and run the fo l l ow i n g commands: (Note log i n as roo t or become roo t by runn i n g command su -l )
[admin@ns1 admin]$ su -l Password: [root@ns1 root]# mount /mnt/cdrom [root@ns1 root]# cd /mnt/cdrom/RedHat/RPMS [root@ns1 root]# rpm -ivh samba-swat-2.2.3a-6.i386.rpm [root@ns1 root]# cd;umount /mnt/cdrom;eject

Above commands can be exp l a i n e d as fo l l ow s: Commands Use for Become roo t (admins t r a t o r ) so tha t re s t of su -l in s t a l l a t i o n conf i g u r a t i o n can be done. Mount the cdrom so th a t we can in s t a l l th e mount /mnt/cd r om swat cd / cur r t mnt/cd r om/RedHat/RP Change RPMS e n r e cwork i ng di r e c t o r y to Red Hat ' s di to ry MS rpm -ivh samba- swa t- Using rpm too l we can in s t a l l the swa t 2.2.3a- 6.i386.rpm cd;umount / Unmount the CDROM and e j e c t th e cd. mnt/cd r om;e j e c t

1.4.1 What i s swa t ?


Swat i s web admin i s t r a t i o n too l fo r samba se r v e r . Using th i s too l you can con t r o l /et c/ s amba/smb.conf f i l e . You don ' t have to manua l l y ed i t th i s f i l e to run samba se r v e r . Swat se r v i c e run f r om xine t d - in t e r n e t ' s supe r- se r v e r . By def au l t on Red Hat 5

Linux 7.3 th i s se r v i c e i s tu r n of f fo r secu r i t y re a s on s, you need to s t a r t th i s se r v i c e befo r e us i ng swat f r om any web browse r.

1.4.2 How to s t a r t swat se r v i c e ?


Swat l i s t e n on 901 por t. Befo r e s t a r t i n g swat f r om your windows web browse r or f r om Linux se r v e r i t s e l f you have to make change s in /et c/x i n e t d.d/swa t f i l e as fo l l ow s:
[root@ns1 root]# cd /etc/xinetd.d/ [root@ns1 xinetd.d]# vi swat

Look fo r the en t r y ca l l e d di s ab l e yes to no . I f you want to run th e (us i n g browse r) then se t (put) the f r on t of on ly_ f r om a t t r i b u t e . For se r v i c e s f r om Windows 98 machine then your en t r y shou l d look l i k e 127.0.0.1

and change i t s va l u e f r om swa t se r v i c e s f r om remot e l y IP addr e s s of your machine in e.g. i f you want to use swat hav i ng IP add r e s s 192.168.1.2 on ly_ f r om = 192.168.1.2

At th e end you f i l e shou l d look l i k e as fo l l ow s:


service swat { port = 901 socket_type = stream wait = no only_from = 192.168.1.2 127.0.0.1 user = root server = /usr/sbin/swat log_on_failure += USERID disable = no }

Save the above f i l e and re s t a r t th e xine t d daemon and s t a r t the ht t p d daemon (i f i t s not runn i n g) as fo l l ow s:
[root@ns1 xinetd.d]# /etc/rc.d/init.d/xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] [root@ns1 xinetd.d]# /etc/rc.d/init.d/httpd start Starting httpd: [ OK ]

How to s t a r t swat f rom Windows Based browse r?


Open the Web browse r f r om windows c l i e n t machin e and type URL as ht t p:// ip- add r e s s - of- l i n u x- se r v e r :901, so i f your IP Addre s s of Linux se r v e r i s 192.168.1.1 th en URL becomes ht t p://192.168.1.1:901 . Also make su r e you run th e above ur l f r om the same windows machine whose IP Addre s s i s pu t in only_ f r om a t t r i b u t e in / e t c/x i n e t d.d/swat f i l e

How to s t a r t swat f rom Linux Based browse r?


To open swat on Linux Serve r s browse r i t se l f , th en typ e URL as ht tp://lo c a l h o s t : 901/ or ht t p://127.0.0.1:901/ in Net s c a p e or konque r o r browse r. I pre f e r r e d to use Linux se r v e r so the re s t of the images in th i s tu t o r i a l s ar e a l s o t aken f r om th e same. You wi l l ask fo r use r name and pas sword, type roo t as use r n ame and pas sword fo r roo t . Ple a s e not th a t i f you giv e othe r use r name & pas sword you wi l l ab l e to see the conf i g u r a t i o n but can not make any changes unt i l and unl e s s you ar e supe r use r roo t.

Fig.2: swat - Authen t i c a t e

you befo r e s t a r t i n g con f i g u r a t i o n of samba se r v e r th en you wil l ge t home page of

Once you au t h en t i c a t e swat as fo l l ow s:

your s e l f

Fig.3: swa t - Home Page and Admini s t r a t i o n Opt i on s (Top of the Page) Aft e r succe s s f u l l y open i ng the swa t home page, you can con t r o l most of th e samba se r v e r us i ng th e opt i o n loc a t e d top of th e home page (Home, Globa l s e t c) 9

Fig.4: swat - Opt i on s Toolba r (But t on s)


Swat Toolbar Icon s/But t on s Use for

HOME GLOBALS SHARES PRINTERS STATUS VIEW PASSWORD

Thi s Icon/But t o n wi l l l e t you open swa t home page. Use to se t globa l s sec t i o n of smb.con f. Use to def i n e sha r e s fo r se r v e r l i k e CDROM dr i v e connec t e d to se r v e r or norma l di r e c t o r y on se r v e r . Use th i s opt i o n fo r pr i n t e r sha r i n g. I t shows Serve r Sta t u s l i k e who i s connec t e d to samba se r v e r , f i l e opened by use r s e t c. Also you can s t a r t and s t op samba se r v e r f r om th i s opt i o n. I t l e t s vi ew you the smb.conf f i l e . Use th i s opt i o n fo r Samba pas sword managemen t (Like new use r add i t i o n , pas swo rd change e t c).

smb.conf f i l e div i d e d in t o seve r a l sec t i o n, minimum you have to conf i g u r e GLOBALS Sec t i o n and th en re s t of th e sha r e s l i k e HOME (User s home di r e c t o r y ), re sou r c e s sha r i n g l i k e CDROM, Fold e r s e t c.

1.4.3 Conf i g u r i n g Samba se r v e r s GLOBALS sec t i o n (smb.conf)


Globa l s sec t i o n in your samba se r v e r i s the f i r s t sec t i o n which i s used con t r o l ove r a l l Samba se r v e r s opt i o n s l i k e name of se r v e r , au t h en t i c a t i o n method e t c. Next we ar e going to se t samba se r v e r s name, workg roup and au t h e n t i c a t i o n method. Cl i ck on "GLOBALS" i con/bu t t o n (top of the page) and se t the fo l l ow i n g samba se r v e r s globa l op t i o n s with given par ame t e r s .
Opt ion s Paramete r s Remark

10

workg roup

ne t b i o s name

se r v e r s t r i n g

Encryp t pas sword s

hos t s al l ow

Try to se t same workg roup name fo r OFFICE al l c l i e n t s , so tha t th i s name can be used in query. Name of Serve r (Thi s LinuxSe r v e r name i s shown in Network Neighborhood ) Thi s s t r i n g appea r in browse l i s t s nex t Samba Pr i n t & Fi l e to the machine name Serve r in ne two rk Neighbo r hood. For Windows 98 and above NT 4 wi th Yes Serv i c e Pack 3 or above requ i r e s th i s se t to be t r u e. Use to spec i f i e s which hos t s/ c ompu t e r s ar e permi t t e d to acce s s a Samba Serve r s se r v i c e s i.e. sha r e d re sou r c e s . We want to re s t r i c t th e acce s s to Loca l Network (In t e r n a l 192.168.1.0/255.255.255 LAN) and no t to the .0 ex t e r n a l Network (In t e r n e t ). Ple a s e not tha t her e we are us i ng 192.168.1.0 C Clas s Network range. I f you ar e us i ng A or B Clas s make the approp r i a t e change s her e.

11

Fig.5: swat - Globa l s Opt i on Page

12

Make su r e secu r i t y (Authen t i c a t i o n ) method i s USER l ev e l . Fina l l y c l i c k on "Commit Change s " But t o n to f i n i s h the bas i c conf i g u r a t i o n of GLOBALS sec t i o n of smb.con f (Samba se r v e r )

1.4.4 Crat i n g Samba Password databa s e


Password ar e used to au t h en t i c a t e var i o u s se r v i c e s prov i d e d by samba se r v e r . Windows use s i t own method of s t o r i n g pas sword and Linux use s i t s own method of s t o r i n g pas swor d in f i l e s , fu r t h e r both windows and Linux use s di f f e r e n t method s to enc r yp t th e pas sword s. In Linux pas sword s ar e s t o r e d in /et c/pas swd (use r in f o rma t i o n) or /et c/ shadow (pas sword s) f i l e s . You can use th e same Linux use r name which i s s t o r e d in pas sword f i l e s on Linux Serve r , but not the pas sword. The pas swo rd managemen t and au t h e n t i c a t i o n i s di f f e r e n t on bo th windows and Linux. Hence samba main t a i n e d sepa r a t e enc r yp t e d pas sword f i l e : /et c/ s amba/smbpas swd . You can use smbpas swd prog r am to change th e pas sword of use r. You have to add new use r to samba pas sword da t a b a s e so tha t samba cab au t h en t i c a t e the cor r e c t use r aga i n s t any se r v i c e i t prov i d e to use r.

1.4.4.1 How to add new use r to Samba pas sword databa s e ?


There are two methods to add use r to samba pas sword da t a b a s e: Method f i r s t : Thi s method app l i e s to use r whose accoun t a l r e a d y pre s e n t on Linux se r v e r . You can use swat to add use r to pas sword da t a b a s e f i l e as fo l l ow s:

13

To add the admin use r t o samba pas sword da t a b a s e: (admin use r accoun t i s a l r e a d y pre s e n t Linux se r v e r so no need to add admin use r)

Cl i ck on "PASSWORD Icon. " Type User Name: admin Type the new use r pas sword (aga i n re t y p e the same pas sword) Cl i ck on "Add New User " but t o n to add admin use r to pas sword dat a b a s e f i l e .

Fig.6: swa t - Pas sword Opt i o n Page Remember th i s admin use r pas sword cab be di f f e r e n t (norma l l y i t shou l d be di f f e r e n t fo r secu r i t y rea s o n s) f r om the our norma l sys t em ' s admin accoun t. Add the re s t of the use r s of your ne twork by above ment i on ed method. Method Second: Second method invo l v e s the cr e a t i o n of use r s accoun t on Linux se r v e r f i r s t , and then add i t to samba pas sword da t a b a s e. You can cr e a t e new use r us i n g redha t- conf i g- user s use r managemen t 14

too l (You can run th i s too l f r om KDE - GUI Desk t op by c l i c k i n g on kon t r o l - pane l > User Manager) or use command l i n e prog r am use r a d d. (For e.g. # useradd ran i ). Then add the use r to pas sword da t ab a s e us i ng swat as ment i o n e d above or use "smbpasswd -a " sambas ut i l i t y as shown be l ow. To add new use r l e t s say ra ju f r om she l l prompt i t se l f and not us i n g swat then use fo l l ow i ng two command:
# useradd raju # smbpasswd -a raju New SMB password: rajus password Retype new SMB password: rajus password Added user raju. Password changed for user raju.

Above commands can be exp l a i n e d as fo l l ow s: Commands Use for Add new use r ra j u to Linux Password da t a b a s e useradd raju fi l e. Add the use r ra j u to Samba pas swor d da t a b a s e smbpasswd -a raju f i l e (ind i c a t e d by -a opt i o n) and se t th e new pas sword.

1.4.5 Crat i n g shar ed re s our c e s


Shar i n g fo l d e r us i ng windows 95/98 i s very easy, ju s t r i g h t c l i c k on fo l d e r , se l e c t the shar i n g opt i o n, spec i f y sha r e name and pas sword, cl i c k on "Ok" to sha r e the fo l d e r . Simi l a r l y you can sha r e fo l d e r s on Linux se r v e r so tha t use r can s t o r e / s h a r e f i l e s eas i l y . Here we wi l l sha r e Linux se r v e r di r e c t o r y ca l l e d /home/publ i c , th i s di r e c t o r y (fo l d e r ) i s used by a l l use r to s t o r e commonly used f i l e s . For th i s purpo s e we need to use "SHARE op t i o n of swa t. " (a) Cl i c k on "SHARE i c on. " (b) Type publ i c in f r o n t of cr e a t e sha r e t ex t box and c l i c k on "Crea t e Share " but t o n. (c) For comment se t par ame t e r as - Publ i c Direc t o r y (d) For pa th se t par ame t e r as - /home/publ i c (e) Set gues t ok to - Yes (f ) Cl i c k on "Commit Changes " But t on.

15

Fig.7: swa t - How to add new sha r e (How to sha r e fo l d e r ) (g) Open your t e rm i n a l window and type fo l l ow i n g two commands a t she l l prompt: # mkdir /home/publ i c # chmod 0777 /home/pub l i c # chmod o+t /home/publ i c Above commands can be exp l a i n e d as fo l l ow s: Commands Use for Crea t e di r e c t o r y /home/publ i c so tha t a l l of mkdir /home/public use r put the sha r e d f i l e s in th i s fo l d e r s
chmod 0777 / home/public

Make th e di r e c t o r y wor ld re ad ab l e. Set th e s t i c k y bi t on pub l i c l y sha r e d fo l d e r so tha t th e owner of the f i l e can del e t e the f i l e . Gener a l l y i f a use r has wri t e permi s s i o n to a di r e c t o r y then use r can de l e t e any f i l e f r om the di r e c t o r y. Note th a t se t s t i c k y bi t on ly fo r pub l i c l y sha r e d fo l d e r s .

chmod o+t / home/publ i c

Use sha r e opt i o n to sha r e CD-ROM dr i v e, Floppy dr i v e, Par t i t i o n (Linux/DOS/Windows/NFS) e t c.

1.4.5.1 Shar i n g Serve r s CDROMDriv e


(a) Cl i c k on "SHARE i c on. " (b) Type cdrom in f r o n t of cr e a t e sha r e t ex t box and c l i c k on "Crea t e Share " but t o n. (c) For comment se t par ame t e r as - Linux Serve r s CD-Rom Drive (d) For pa th se t par ame t e r as - /mnt/cdrom (e) Set gues t ok to - Yes (f ) Cl i c k on "Commit Changes " But t on.

16

Fig.8: swa t - Shar i n g CDROM Drive

Note tha t you can mount the CDROM dr i v e as use r c l i c k s on th i s sha r e f r om any windows c l i e n t . Thi s wil l hel p use r s , becau s e withou t mount i n g CDROM you can ' t use i t and eve ry t ime roo t use r might be not ava i l a b l e . (a) Cl i c k on "Advance vi ew " but t o n fo r CDROM sha r e, then sc r o l l down to Misce l l a n e ou s Opt ion s (b) Set roo t preexe c to mount /mnt/cdrom (c) Set roo t pos t e x e c to umount /mnt/cdrom (d) Cl i c k on "Commit Changes " But t on.

Fig.9: swat - Automat i c a l l y

mount i n g & unmount i n g of f i l e s .

1.4.6 Star t i n g smbd & nmbd demons


Aft e r making above se t t i n g , now i t s t ime to s t a r t You can do th i s f r om swat as fo l l ow s:

samba se r v e r .

Cick on "STATUS" opt i o n. Cl i ck on Star t smbd and Star t nmbd but t o n to s t a r t daemons. samba

17

Or manul l y you can s t a r t command:

th e samba se r v e r by runn i n g

# /et c/ r c.d/ i n i t . d/ smb s t a r t

1.4.7 Samba se rv e r in Act i o n


From Windows machine log i n us i ng your use r n ame & pas sword. Open the Network Neighborhood on windows cl i e n t , you shou l d see LinuxSe r v e r . Double c l i c k on i t (I t may ask you pas sword), give the cur r e n t l y log i n use r s pas sword (th i s pas sword i s en t e r by you a t PASSWORDS opt i o n of the swat), you can now see use r s home di r e c t o r y as wel l as Publ i c di r e c t o r y and CDROM.

Fig.10: Network Neighbo r hood af t e r se t t i n g Samba showing Wks (windows 98) & LinuxSe r v e r

18

Fig.11: Network Neighbo r hood Showing LinuxSe r v e r ' s fo l d e r s / r e s o u r c e s .

sha r e d

1.5 Shar i ng Pr in t e r
Pr i n t e r sha r i n g i s ano t h e r impor t a n t fea t u r e of any ne twork. You can sha r e pr i n t e r connec t e d to Linux se r v e r or pr i n t e r connec t e d to windows comput e r wi th Linux. Next par t of the tu t o r i a l wi l l show you how to ach i e v e th i s . You can sha r e th e pr i n t e r two ways:

19

1) Your pr i n t e r i s connec t e d to ano t h e r Windows Machine - you can sha r e th i s us i n g samba and want to pr i n t f r om Linux i t s e l f . 2) Your pr i n t e r i s connec t e d to Linux Serve r i t s e l f windows c l i e n t s want s to use i t . and a l l

Red Hat Linux 7.3 prov i d e s th e graph i c a l X windows too l pr i n t c o n f ut i l i t y . Thi s ut i l i t y wri t e s i t s con f i g u r a t i o n to / e t c/p r i n t c a p f i l e and manages the f i l t e r s and spoo l i n g fo r your pr i n t e r .
pr in t c on f too l cab be s t a r t

as fo l l ow s:

From KDE Desk t op > Cl i c k on Cont r o l - pane l > Cl i c k on Pr i n t e r Conf i g u r a t i o n , which wi l l open windows as shown in Fig. 21 . Once you s t a r t e d to add the pr i n t e r i t wil l give you cho i c e s how the sys t em wi l l communica t e wi th th e pr i n t e r (as shown in Fig.17 )
Queue Type Loca l Pr i n t e r (LOCAL) Use for

Thi s kind of pr i n t e r ( s ) di r e c t l y a t t a c h e d to the one of the por t of Linux Serve r i t s e l f .

Thi s kind of pr i n t e r at t a c h e d to ano t h e r remot e Unix/Linux compute r sys t em and can be acce s s ove r TCP/IP ne twor k. Windows Thi s kind of pr i n t e r at t a c h e d sys t em which work Pr i n t e r (SMB) on SMB ne twork (l i k e Microso f t Windows) Novel l Pr i n t e r (NCP) Thi s kind of pr i n t e r at t a c h e d Nove l l Network Je tD i r e c t Thi s kind of pr i n t e r di r e c t l y connec t e d to Pr i n t e r ne two rk i.e. Network pr i n t e r , th i s kind of pr i n t e r (JETDIRECT) have ded i c a t e d IP addr e s s . Unix Pr i n t e r (LPD) Aft e r se l e c t i n g the Queue type you need to spec i f y the pr i n t e r dr i v e r .

1.5.1 Pr in t e r i s conne c t e d to Anothe r Windows Sys t em

20

In my ne twork I use EPSON 670 Colo r Pr i n t e r which i s connec t e d to Windows ME based Sys t em. I as sume tha t pr i n t e r dr i v e r s ar e in s t a l l e d . Fi r s t s t e p i s to sha r e the pr i n t e r as fo l l ows on Windows ME based sys t em: Sta r t Windows based sys t em and log i n to i t . Then 1) Goto Sta r t > Se t t i n g s > Pr i n t e r s

Fig.12: Shar i n g Windows Pr i n t e r 2) Sel e c t the pr i n t e r Shar i n g (EPSON 670) > Righ t Cl i c k i t > Sel e c t

21

Fig.13: Shar i n g Pr i n t e r

in Windows

3) In the Pr i n t e r Prope r t i e s di a l o g box Cl i c k on > Sha r ed As rad i o but t o n > Ent e r Shar e Name "EPSON" > Set Comment as "Epson 670 Pr i n t e r " > I f you want th e pas sword pro t e c t e d pr i n t e r then Give Password > Cl i c k on "OK but t o n. "

22

Fig.14: Pr i n t e r

sha r e d as EPSON

Cl i ck on "Ok" But t on. Now your pr i n t e r connec t e d to windows machine i s sha r e d and ava i l a b l e to othe r windows machin e as wel l as fo r Linux machin e us i n g samba c l i e n t . You can now use any windows machine to connec t th e pr i n t e r , download the dr i v e r f r om tha t machine and pr i n t i t . Even you can use Linux Serve r or Works t a t i o n to pr i n t on th i s remo t e windows pr i n t e r . For th i s purpos e you need to use Samba i.e. Sambas Cl i e n t prog r am to connec t to th i s pr i n t e r and pr i n t i t . But befo r e tha t you need to add th i s pr i n t e r to your Linux works t a t i o n s or se r v e r as fo l l ows: 1) Login to Linux se r v e r . Sta r t th e X Windows (KDE) and th en Open Cont r o l - pane l > Cl i ck on Pr i n t e r Conf i g u r a t i o n , which wi l l open windows as fo l l ows:

23

Fig.15: pr i n t c o n f Ut i l i t i e s

main sc r e e n (i.e. pr i n t queue)

2) Cl i ck on New but t o n to to add new pr i n t e r

24

Fig.16: Adding new smb pr i n t e r

wi th wiza r d s

3) Set th e queue name to WIN_EPSON > Se l e c t Queue type as Windows Pr in t e r > Cl i c k on Next but t o n to con t i n u e.

25

Fig.17: Pr i n t e r

Queue name and type as Windows Pr i n t e r

(SMB)

4) Set th e opt i o n s as fo l l ow s:
Opt ion Se t to Value/At t r i b u t e Remark

Shar e Host IP

\ \wk s \ EPSON 192.168.1.3

Workgroup OFFICE User Pas sword ---

Spec i f y the Windows Pr i n t e r Shar e name as \ \ c ompu t e r n ame \ s h a r e - name IP Addre s s of machine where pr i n t e r i s connec t e d. Workgroup name Set th e use r n ame, in our case we have no t any use r n ame whi l e sha r i n g pr i n t e r . Set th e pas sword, in our case we have no t any use r n ame whi l e sha r i n g pr i n t e r .

-- Ind i c a t e s none. Cl i ck on nex t but t o n to con t i n u e.

26

Fig.18: Conf i gu r i n g remot e windows pr i n t e r 5) Sel e c t the pr i n t e r dr i v e r as Pos t s c r i p t on Next but t o n to con t i n u e. Pr i n t e r and Cl i c k

27

Fig.19: Se l e c t i n g pr i n t dr i v e r fo r remot e pr i n t e r .
Caut i on: Don' t se l e c t fo l l ow s: Prin t e r Driv e r

her e pr i n t e r

dr i v e r , in s t a t e d se l e c t

as

Why

Example

Pos t s c r i pt Pr i n t e r Tex t Only Pr i n t e r Raw Pr i n t Queue

Se l e c t th i s i f you have co lo r DeskJ e t , Pos t s c r i p t pr i n t e r . Se l e c t th i s i f remot e pr i n t e r on ly suppo r t s t ex t l i k e Dot Matr i x pr i n t e r Se l e c t th i s fo r ne twork pr i n t e r or i f bot h of above don ' t works.

Most l y a l l DeskJe t , Pos t s c r i p t Pr i n t e r s l i k e EPSON 670 or HP DJ-840 Dot Matr i x Pr i n t e r l i k e EPSON or TVSE or WIPRO Network pr i n t e r you do as fo l l ows:

When you ar e pr i n t i n g on remot e pr i n t e r

Your- Document/ Image -> Remote Pr i n t e r Drive r > Remote Pr i n t e r

28

And not as fo l l ow s: (which i s not cor r e c t ) Your- Document/ Image -> Loca l Prin t e r Drive r -> Remote Pr i n t e r Driv e r > Remote Pr i n t e r So wheneve r you pr i n t on any of the remot e pr i n t e r NPC e t c) use th e above th r e e as pr i n t e r dr i v e r . (SMB, LPD,

6) Fina l l y c l i c k on f i n i s h bu t t o n to f i n i s h th e conf i g u r a t i o n and add th i s pr i n t e r to Linux Serve r /Works t a t i o n .

Fig.20: Fin i s h i n g the smb pr i n t e r

conf i g u r a t i o n the

Now save your change s as: Fi l e > Save Changes and re s t a r t lpd so tha t new pr i n t e r can be used. Use lp r command to pr i n t f r om Linux se r v e r to smb pr i n t e r . # lp r memo1.tx t

29

In cas e you have more pr i n t e r then you can run fo l l ow i ng command: (remember th i s pr i n t e r queue name i s win_epson, See the Fig.17 ) # lp r -Pwin_epson memo1.tx t To see s t a t u s of def au l t # lpq To see s t a t u s of a l l pr i n t e r # lpq -a To remove a l l pr i n t job f r om queue (i.e. s t op pr i n t i n g) give command: # lp rm -a To remove job no. 15 f r om pr i n t e r # lp rm -Pwin_epson 15 win_epson give command: give command: pr i n t e r give command:

1.5.1 Pr in t e r i s conne c t e d to Linux Serve r itsel f.


Ple a s e not e th a t I am showing you same pr i n t e r fo r th i s par t of tu t o r i a l . (i.e. Epson 670 Pr i n t e r ), so don ' t ge t puzz l e d her e. Login to Linux se r v e r . Sta r t the X Windows (KDE) and then Open kont r o l - pane l > Cl i c k on Pr i n t e r Conf i g u r a t i o n , which wi l l open windows as fo l l ows:

30

Fig.21: In s t a l l i n g Loca l Pr i n t e r Cl i ck on "New" But t on to add new pr i n t e r (i.e pr i n t queue)

Fig.22: Cl i c k on New bu t t o n

31

Add new pr i n t e r but t o n.

(Pr i n t Queue Wizard Sta r t s ) and cl i c k on "Next "

Fig.23: Sta r i n g Wizard to add the new pr i n t e r Type the Queue name as "EPSON and se l e c t pr i n t e r queue type as " "Loca l Prin t e r (LOCAL)" and cl i c k on "Next " bu t t o n.

32

Fig.24: Set Queue name & typ e pr i n t c o n f wil l t r y to de t e c t your pr i n t e r au toma t i c a l l y , i f i t s det e c t e d i t wi l l show th e fo l l ow i n g window > Cl i ck Next to con t i n u e.

33

Fig.25:

Pr i n t e r

i s au toma t i c a l l y

de t e c t e d by pr i n t c o n f

pr i n t c o n f wil l a l s o se l e c t s dr i v e r fo r you, i f i t ' s not cor r e c t se l e c t th e one acco r d i n g to your pr i n t e r > Cl i ck Next but t o n to con t i n u e.

34

Fig.26: In s t a l l i n g Pr i n t e r

dr i v e r

Fina l l y pr i n t e r i s in s t a l l e d , c l i c k on Fin i s h bu t t o n to cr ea t e the en t r y in /et c/p r i n t c a p f i l e .

35

Fig.27:
Note: I f your pr i n t e r cus t om dev i c e.

i s not de t e c t e d you need to spec i f y th e

Now c l i c k on Fi l e > Save Changes. I f you di r e c t l y give command Fi l e > Qui t, Fol l ow i ng di a l o g box wi l l appea r on sc r e e n: (Cl i ck on "Yes " bu t t o n to save change s)

Fig.28: Sel e c t yes to save changes Fina l l y you wi l l ge t fo l l ow i n g sc r e e n i.e. lpd re s t a r t succe ed ed. 36

Fig.29: Your lpd r e s t a r t e d and new pr i n t e r

i s ready to use.

Aft e r se t t i n g the pr i n t e r wi th Linux, ju s t re s t a r t th e smb by runn i n g fo l l ow i ng command, th i s ensu r e s tha t Linux pr i n t e r ge t s re ady fo r samba. # /et c/ r c.d/ i n i t . d/ smb re s t a r t Once re s t a r t e d now you can browse th e pr i n t e r Neighbo r hood as shown in fo l l ow i ng f i gu r e : in Network

Fig.30: New pr i n t e r

shown f r om Network Neighbo r h ood or My Network Pla c e

But befo r e us i ng th i s pr i n t e r f r om any windows based ne twork you need to connec t th i s pr i n t e r (ins t a l l the dr i v e r - c l i e n t s i d e) as fo l l ows: Open Network Neighbo rhood f r om window machine: Righ t Cl i ck on pr i n t e r menu. (Epson) > Cl i c k on "Open " or "Connec t "

37

Fig.31: In s t a l l i n g Cl i e n t Side Drive r Thi s wil l s t a r t con t i n u e. Add Pr i n t e r Wizard > Cl i c k on "Next " bu t t o n to

Fig.32: Wizard s t a r t s

to in s t a l l

the pr i n t e r

Sel e c t "Network Pr in t e r " so tha t we can pr i n t on pr i n t e r connec t e d to Linux Serve r > Cl i c k on "Next " bu t t o n to con t i n u e.

38

Fig.33: You l i k e to se t Network pr i n t e r Cl i ck on "Browse " bu t t o n to give Linux se r v e r Queue or you can type as \ \ L i n u x s e r v e r - name\queu e name.

Fig.34: Spec i f y the Network pa t h of pr i n t e r Cl i ck on Workgroup name (in our case i t s OFFICE) > Then Cl i c k on Linux se r v e r > And f i n a l l y on sha r e d pr i n t e r name > Fina l l y c l i c k on "OK but t o n. "

39

Fig.36: Spec i f y i n g the ne two rk pa t h fo r pr i n t e r bu t t o n Now c l i c k on "Next " but t o n to con t i n u e.

us i ng browse

Fig.37: Network pa t h i s given At th i s s t a g e Wizard wi l l ask the dr i v e r fo r Windows EPSON 670 (Cl i e n t s i d e) you need to give th i s dr i v e r f r om Floppy/CD or i f i t s s t o r e d somewhere in the hard dr i v e. Cl i c k on "Have Disk... " but t o n.

40

Fig.38: In s t a l l i n g the dr i v e r fo r windows Sel e c t th e approp r i a t e pl a c e and type th e pa th in box. (where your pr i n t e r s dr i v e r ar e s t o r e d)

Fig.39: Spec i f y i n g the lo c a t i o n of dr i v e r Wizard wi l l au toma t i c a l l y de t e c t and shows you pr i n t e r ju s t cl i c k on "Next " bu t t o n to con t i n u e. name,

41

Fig.40: Windows wi l l show the ava i l a b l e pr i n t e r

dr i v e r ( s)

Type the pr i n t e r name and c l i c k on "Fin i s h " but t o n to f i n i s h the conf i g u r a t i o n .

Fig.41: Give name to pr i n t e r Windows wi l l copy the pr i n t e r fi l e s.

42

Fig.42: Windows copy i ng th e f i l e s And f i n a l l y shows the di a l o g, conf i rm s tha t se t u p i s comple t e d succe s s f u l l y .

Fig.43: Now you can pr i n t f r om any app l i c a t i o n to th i s smb pr i n t e r . Aft e r above con f i g u r a t i o n you want to s t a r t the Samba se r v e r au t oma t i c a l l y wi th each and eve ry t ime sys t em ge t s reboo t s , run the fo l l ow i ng command fo r th i s purpo s e. # chkcon f i g --l ev e l 35 smb on

1.6 Resourc e s
(1) (a) (b) (c) (d) (e) Man man man man man man Pages: smb.conf : Al l the conf i g u r a t i o n opt i o n s fo r samba. lpq: Al l th e opt i o n s re l a t e d to lpq command. lp rm: Al l th e opt i o n s re l a t e d to lp rm command. lpd: In f o rma t i o n on l i n e pr i n t e r daemon. lpc: Line Pr i n t e r con t r o l prog r am man page.

43

(2) Swat Document a t i o n : Swat s f i l e s main page con t a i n s : Documenta t i o n

Book - Using Samba - wri t t e n by Rober t Ecks t e i n , David Col l i e r - Brown and Pet e r Kel l y Samba HOWTO Col l e c t i o n Othe r ut i l i t i e s in f o rma t i o n.

44

You might also like