centos6.x+samba4+cups+hp laserjet1020共享打印機


第一步,安裝相關軟件

   1  2013-04-10_01:22:27 service iptables stop
   2  2013-04-10_01:22:32 setenforce 0
   3  2013-04-10_01:22:55 yum remove `rpm -qa|grep samba`
   4  2013-04-10_01:23:41 yum install samba4*
   5  2013-04-10_01:25:20 cd /tmp
   6  2013-04-10_01:25:24 wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
   7  2013-04-10_01:25:50 tar zxf foo2zjs.tar.gz
   8  2013-04-10_01:25:57 cd foo2zjs
   9  2013-04-10_01:26:14 make
  10  2013-04-10_01:26:36 make install
  11  2013-04-10_01:26:49 make install-hotplug
  12  2013-04-10_01:26:57 make cups
  13  2013-04-10_01:27:17 ln -s `which smbspool` /usr/lib/cups/backend/smb


第二步,使用cups添加打印機,以及從Windows XP提交驅動到samba服務器


   1  2013-04-10_01:48:38 service smb start
   2  2013-04-10_01:48:45 smbpasswd -a root
   3  2013-04-10_01:49:13 net rpc rights grant "localhost\root" SePrintOperatorPrivilege -U localhost/root   #賦權,打印機管理員
   4  2013-04-10_01:50:23 vi p.sh
   5  2013-04-10_01:50:31 sh p.sh
   6  2013-04-10_01:51:12 vi /etc/samba/smb.conf
   7  2013-04-10_01:53:35 cd /var/lib/samba/
   8  2013-04-10_01:53:41 ll -d drivers/
   9  2013-04-10_01:54:24 service smb restart
  10  2013-04-10_02:01:57 ll -d drivers/
  11  2013-04-10_02:02:07 chmod 777 drivers/ #這不是必須的,
  12  2013-04-10_02:02:34 chmod 755 drivers/  #因爲上面不是必須的,若沒執行上面的那條,這條也不用執行
  13  2013-04-10_02:02:37 ll -d drivers/
  14  2013-04-10_02:02:51 vi /etc/samba/smb.conf
  15  2013-04-10_02:03:09 service smb reload  #此處,reload試過,發現依然不能提交驅動
  16  2013-04-10_02:03:24 service smb restart #restart後,可以提交驅動給samba
  17  2013-04-10_02:10:32 cd /var/lib/samba/drivers/W32X86/
  18  2013-04-10_02:10:34 LS  #這是錯誤的命令,不用
  19  2013-04-10_02:10:36 ls  #看看這裏有沒有什麼文件
  20  2013-04-10_02:10:39 cd 3 #進入目錄
  21  2013-04-10_02:10:40 ls #查看目錄內容,會發現Windows XP上傳的驅動文件

p.sh
######################################
BASEDIR=/srv/samba/Printer_drivers
for i in COLOR IA64 W32ALPHA W32MIPS W32PPC W32X86/{2,3} WIN40 x64; do
    mkdir -p $BASEDIR/$i;
done
######################################

[root@localhost 3]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
   workgroup = MYGROUP
   server string = Samba Server Version %v
   log file = /var/log/samba/log.%m
   max log size = 50
   idmap config * : backend = tdb
   cups options = raw

[homes]
   comment = Home Directories
   read only = No
   browseable = No

[printers]
   comment = All Printers
   path = /var/spool/samba
   printable = Yes
   print ok = Yes
   browseable = No

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/drivers
   write list = root
   read only = No


參考:https://wiki.samba.org/index.php/Setup_a_printer_share

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章