Using Samba-7. Printing and Name Resolution-P1
Số trang: 26
Loại file: pdf
Dung lượng: 0.00 B
Lượt xem: 10
Lượt tải: 0
Xem trước 3 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
7. Printing and Name ResolutionThis chapter tackles two Samba topics: setting up printers for use with a Samba server and configuring Samba to use or become a Windows Internet Name Service (WINS) server. Samba allows client machines to send documents to printers connected to the Samba server. In addition, Samba can also assist you with printing Unix documents to a printer on a Windows machine. In the first part of this chapter, we will discuss how to get printers configured to work on either side.In the second half of the chapter, we will introduce the Windows Internet Name Service, Microsofts...
Nội dung trích xuất từ tài liệu:
Using Samba-7. Printing and Name Resolution-P1 7. Printing and Name ResolutionThis chapter tackles two Samba topics: setting up printers for use with aSamba server and configuring Samba to use or become a Windows InternetName Service (WINS) server. Samba allows client machines to senddocuments to printers connected to the Samba server. In addition, Samba canalso assist you with printing Unix documents to a printer on a Windowsmachine. In the first part of this chapter, we will discuss how to get printersconfigured to work on either side. In the second half of the chapter, we will introduce the Windows InternetName Service, Microsofts implementation of a NetBIOS Name Server(NBNS). As mentioned in Chapter 1, Learning the Samba, an NBNS allowsmachines to perform name resolution on a NetBIOS network without havingto rely on broadcasts. Instead, each machine knows exactly where the WINSserver is and can query it for the IP addresses of other machines on thenetwork. 7.1 Sending Print Jobs to Samba A printer attached to the Samba server shows up in the list of sharesoffered in the Network Neighborhood. If the printer is registered on theclient machine and the client has the correct printer driver installed, theclient can effortlessly send print jobs to a printer attached to a Samba server.Figure 7.1 shows a Samba printer as it appears in the NetworkNeighborhood of a Windows client. To administer printers with Samba, you should understand the basicprocess by which printing takes place on a network. Sending a print job to aprinter on a Samba server involves four steps: 1. Opening and authenticating a connection to the printer share 2. Copying the file over the network 3. Closing the connection 4. Printing and deleting the copy of the file Figure 7.1: A Samba printer in the Network Neighborhood Figure 7.1 When a print job arrives at a Samba server, the print data is temporarilywritten to disk in the directory specified by the path option of the printershare. Samba then executes a Unix print command to send that data file tothe printer. The job is printed as the authenticated user of the share. Notethat this may be the guest user, depending on how the share is configured. 7.1.1 Print Commands In order to print the document, youll need to tell Samba what thecommand is to print and delete a file. On Linux, such a command is: lpr -r -P printer file This tells lpr to copy the document to a spool area, usually /var/spool,retrieve the name of the printer in the system configuration file (/etc/printcap), and interpret the rules it finds there to decide how to processthe data and which physical device to send it to. Note that because the -roption has been listed, the file specified on the command line will be deletedafter it has been printed. Of course, the file removed is just a copy stored onthe Samba server; the original file on the client is unaffected. Linux uses a Berkeley (BSD) style of printing. However, the process issimilar on System V Unix. Here, printing and deleting becomes a compoundcommand: lp -d printer -s file; rm file With System V, the /etc/printcap file is replaced with different set ofconfiguration files hiding in /usr/spool/lp, and there is no option to delete thefile. You have to do it yourself, which is why we have added the rmcommand afterward. 7.1.2 Printing Variables Samba provides four variables specifically for use with printingconfiguration options. They are shown in Table 7.1. Table 7.1: Printing Variables Variable Definition %s The full pathname of the file on the Samba server to be printed %f The name of the file itself (without the preceding path) on the Sambaserver to be printed %p The name of the Unix printer to use %j The number of the print job (for use with lprm, lppause, and lpresume) 7.1.3 A Minimal Printing Setup Lets start with a simple but illustrative printing share. Assuming thatyoure on a Linux system and you have a printer called lp listed in the printercapabilities file, the following addition to your smb.conf file will make theprinter accessible through the network: [printer1] printable = yes print command = /usr/bin/lpr -r %s printer = lp printing = BSD read only = yes guest ok = yes This configuration allows anyone to send data to the printer, somethingwe may want to change later. For the moment, whats important tounderstand is that the variable %s in the print command option will bereplaced with the name of the file to be printed when Samba executes thecommand. Changing the print command to reflect a different style of Unixmachine typically involves only replacing the right side of the printcomma ...
Nội dung trích xuất từ tài liệu:
Using Samba-7. Printing and Name Resolution-P1 7. Printing and Name ResolutionThis chapter tackles two Samba topics: setting up printers for use with aSamba server and configuring Samba to use or become a Windows InternetName Service (WINS) server. Samba allows client machines to senddocuments to printers connected to the Samba server. In addition, Samba canalso assist you with printing Unix documents to a printer on a Windowsmachine. In the first part of this chapter, we will discuss how to get printersconfigured to work on either side. In the second half of the chapter, we will introduce the Windows InternetName Service, Microsofts implementation of a NetBIOS Name Server(NBNS). As mentioned in Chapter 1, Learning the Samba, an NBNS allowsmachines to perform name resolution on a NetBIOS network without havingto rely on broadcasts. Instead, each machine knows exactly where the WINSserver is and can query it for the IP addresses of other machines on thenetwork. 7.1 Sending Print Jobs to Samba A printer attached to the Samba server shows up in the list of sharesoffered in the Network Neighborhood. If the printer is registered on theclient machine and the client has the correct printer driver installed, theclient can effortlessly send print jobs to a printer attached to a Samba server.Figure 7.1 shows a Samba printer as it appears in the NetworkNeighborhood of a Windows client. To administer printers with Samba, you should understand the basicprocess by which printing takes place on a network. Sending a print job to aprinter on a Samba server involves four steps: 1. Opening and authenticating a connection to the printer share 2. Copying the file over the network 3. Closing the connection 4. Printing and deleting the copy of the file Figure 7.1: A Samba printer in the Network Neighborhood Figure 7.1 When a print job arrives at a Samba server, the print data is temporarilywritten to disk in the directory specified by the path option of the printershare. Samba then executes a Unix print command to send that data file tothe printer. The job is printed as the authenticated user of the share. Notethat this may be the guest user, depending on how the share is configured. 7.1.1 Print Commands In order to print the document, youll need to tell Samba what thecommand is to print and delete a file. On Linux, such a command is: lpr -r -P printer file This tells lpr to copy the document to a spool area, usually /var/spool,retrieve the name of the printer in the system configuration file (/etc/printcap), and interpret the rules it finds there to decide how to processthe data and which physical device to send it to. Note that because the -roption has been listed, the file specified on the command line will be deletedafter it has been printed. Of course, the file removed is just a copy stored onthe Samba server; the original file on the client is unaffected. Linux uses a Berkeley (BSD) style of printing. However, the process issimilar on System V Unix. Here, printing and deleting becomes a compoundcommand: lp -d printer -s file; rm file With System V, the /etc/printcap file is replaced with different set ofconfiguration files hiding in /usr/spool/lp, and there is no option to delete thefile. You have to do it yourself, which is why we have added the rmcommand afterward. 7.1.2 Printing Variables Samba provides four variables specifically for use with printingconfiguration options. They are shown in Table 7.1. Table 7.1: Printing Variables Variable Definition %s The full pathname of the file on the Samba server to be printed %f The name of the file itself (without the preceding path) on the Sambaserver to be printed %p The name of the Unix printer to use %j The number of the print job (for use with lprm, lppause, and lpresume) 7.1.3 A Minimal Printing Setup Lets start with a simple but illustrative printing share. Assuming thatyoure on a Linux system and you have a printer called lp listed in the printercapabilities file, the following addition to your smb.conf file will make theprinter accessible through the network: [printer1] printable = yes print command = /usr/bin/lpr -r %s printer = lp printing = BSD read only = yes guest ok = yes This configuration allows anyone to send data to the printer, somethingwe may want to change later. For the moment, whats important tounderstand is that the variable %s in the print command option will bereplaced with the name of the file to be printed when Samba executes thecommand. Changing the print command to reflect a different style of Unixmachine typically involves only replacing the right side of the printcomma ...
Tìm kiếm theo từ khóa liên quan:
thủ thuật máy tính công nghệ thông tin quản trị mạng tin học computer networkTài liệu liên quan:
-
52 trang 434 1 0
-
24 trang 359 1 0
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 320 0 0 -
Làm việc với Read Only Domain Controllers
20 trang 311 0 0 -
74 trang 303 0 0
-
96 trang 299 0 0
-
Báo cáo thực tập thực tế: Nghiên cứu và xây dựng website bằng Wordpress
24 trang 291 0 0 -
Đồ án tốt nghiệp: Xây dựng ứng dụng di động android quản lý khách hàng cắt tóc
81 trang 286 0 0 -
EBay - Internet và câu chuyện thần kỳ: Phần 1
143 trang 277 0 0 -
Tài liệu hướng dẫn sử dụng thư điện tử tài nguyên và môi trường
72 trang 270 0 0