Linux网络管理之三:从windows访问Linux共享打印
时间:2009-03-23 来源:sjhf
环境:客户端为windows xp(10.0.0.10); 打印服务器为FC7(10.0.0.100)。
要求:客户端可以通过FC7上的打印机进行网络打印,并可进行基于Web的远程管理。
实现过程:
一、在FC7上安装SMB共享打印机
1、在FC7环境中,点击 settings---->printers,以便进行打印机的安装。
![]() ![]() ![]() ![]() ![]() ![]() # # workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH …………# specifiy it as a per share option as well # workgroup = workgroup ----定义samba服务器所在的工作组或域 server string = printer server ----定义计算机的描述信息 netbios name = lgfc7 ; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 ; hosts allow = 127. 192.168.12. 192.168.13. # ----------------------- Standalone Server Options ------------------------ # Scurity can be set to user, share(deprecated) or server(deprecated) …………# compatibility. tdbsam requires no further configuration. security = share ---------------设置安全级别为共享级别 passdb backend = tdbsam # --------------------------- Printing Options ----------------------------- # # Load Printers let you load automatically the list of printers rather # than setting them up individually # ……# You can choose a non default printing system using the Printing option load printers = yes -----自动加载打印机列表,设置yes后就不必单独设置每一台打印机的共享 cups options = raw printcap name = /etc/printcap #obtain list of printers automatically on SystemV ; printcap name = lpstat printing = cups ----打印系统名称为CUPS(Common UNIX Print System) #================ Share Definitions ==================== [homes] comment = Home Directories browseable = no writable = yes ; valid users = %S ; valid users = MYDOMAIN\%S [printers] comment = All Printers path = /var/spool/samba browseable = no guest ok = yes -----允许匿名访问共享打印机 writable = no printable = yes ----允许打印 2、配置cupsd.conf文件以允许指定主机或网络访问 [root@lgfc7 cups]# pwd /etc/cups [root@lgfc7 cups]# cp cupsd.conf cupsd.conf.bak ----先作备份,以便容错 [root@lgfc7 cups]# vi cupsd.conf # # "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $" # # Sample configuration file for the Common UNIX Printing System (CUPS) # scheduler. See "man cupsd.conf" for a complete description of this file. ……# Only listen for connections from the local machine. port 631 ----------------------把系统监听本的631改为全地址的631 Listen /var/run/cups/cups.sock # Show shared printers on the local network. Browsing On BrowseOrder allow,deny # (Change '@LOCAL' to 'ALL' if using directed broadcasts from another subnet.) ---这个注释可参考一下 BrowseAllow @LOCAL # Default authentication type, when authentication is required... DefaultAuthType Basic # Restrict access to the server... <Location /> Order allow,deny Allow from 10.0.0.10 ----允许访问的客户端主机 </Location> # Restrict access to the admin pages... <Location /admin> Encryption Required Order allow,deny Allow from 10.0.0.10 </Location> # Restrict access to configuration files... <Location /admin/conf> AuthType Basic Require user @SYSTEM Order allow,deny Allow from 10.0.0.10 </Location> # Set the default printer/job policies... <Policy default> …… </Limit> # Only the owner or an administrator can cancel or authenticate a job... <Limit Cancel-Job CUPS-Authenticate-Job> Require user @OWNER @SYSTEM Order deny,allow </Limit> <Limit All> Order deny,allow </Limit> </Policy> # # End of "$Id: cupsd.conf.in 5454 2006-04-23 21:46:38Z mike $". # "cupsd.conf" 78L, 2453C written [root@lgfc7 cups]# service cups restart -----重启cups服务 Stopping cups: [ OK ] Starting cups: [ OK ] [root@lgfc7 cups]# service smb restart ------重启smb服务 Shutting down SMB services: [ OK ] Starting SMB services: [ OK ] [root@lgfc7 cups]# service httpd restart ------重启httpd服务以便基于web管理 三、在windows xp客户机实现网络打印 1、在windows xp客户机上,远程“开始---->运行”,然后输入“\\10.0.0.100”以便远程访问samba服务器FC7上的共享资源。 2、如下图,在出现的访问窗口中,可以看到服务器FC7上的共享资源。然后右击共享的打印机,在出现的菜单中选择“连接”。 ![]() ![]() ![]() ![]() |
相关阅读 更多 +