CUPS Share Printer

系統版本
cat /etc/centos-release
CentOS Linux release 6.0 (Final)

1、安裝yum
mount /dev/cdrom /mnt
rpm -ivh /mnt/Packages/yum-3.2.27-14.el6.centos.noarch.rpm

2、安裝wget
rpm -ivh /mnt/Packages/wget-1.12-1.4.el6.i686.rpm

3、備份yum配置文件
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

4、下載yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

5、yum makecache生成緩存
yum makecache

6、關閉防火牆
service iptables stop
chkconfig iptables off 開機不啓動防火牆
chkconfig --list | grep iptables
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off

7、關閉SELINUX
vim /etc/sysconfig/selinux
SELINUX=disabled

8、安裝Cups
yum install cups
查看安裝的軟件包
rpm -qa |grep cups
cups-1.4.2-78.el6_9.i686
cups-libs-1.4.2-78.el6_9.i686

9、運行cups
service cups start

10、開機自動啓動
chkconfig cups on
chkconfig --list | grep cups
cups 0:off 1:off 2:on 3:on 4:on 5:on 6:off

11、查看cups狀態
service cups status
cupsd (pid 1817) is running...

12、允許遠程訪問CUPS Web
CUPS默認只監聽localhost,修改配置文件,允許any監聽TCP 631
vim /etc/cups/cupsd.conf

把Listen localhost:631修改爲Listen *:631

允許any訪問CUPS WEB
vim /etc/cups/cupsd.conf

如下增加Allow all字段

Restrict access to the server...

<Location />
Order allow,deny
Allow all
</Location>

Restrict access to the admin pages...

<Location /admin>
Order allow,deny
Allow all
</Location>

Restrict access to configuration files...

<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow all
</Location>

重啓服務 service cups restart

13、訪問CUPS WEB
https://IP:631/admin/
登錄賬號使用root密碼

Add print

15、查看打印錯誤log
more /var/log/cups/error_log

16、安裝samba
yum install samba

安裝的軟件包
rpm -qa |grep samba
samba-winbind-clients-3.6.23-46el6_9.i686
samba-3.6.23-46el6_9.i686
samba-winbind-3.6.23-46el6_9.i686
samba-common-3.6.23-46el6_9.i686

17、添加共享打印
vim /etc/samba/smb.conf

[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = yes
writable = no
read only = yes
printable = yes

18、重啓smb服務
service smb status
smbd (pid 2140) is running...

19、設置無認證共享
vim /etc/samba/smb.conf

[global]
workgroup = MYGROUP
server string = Samba Server Version %v
security = user
map to guest = Bad User

20、測試打印

\10.4.8.249

打印一個文檔,選擇共享打印機,可以打印

21、通過CUPS WEB查看相關打印log
查看打印作業記錄,如下,已完成一次打印

22、查看log
Page_log,如下pc-10.4.10.53使用打印機ZD-15F-PRINT-10.4.10.190完成了打印

ZD-15F-PRINT-10.4.10.190 7 root [21/Mar/2018:20:44:36 +0800] 1 1 - 10.4.10.53 smbprn.00000001 Linux - -
ZD-15F-PRINT-10.4.10.190 7 root [21/Mar/2018:20:44:47 +0800] 1 1 - 10.4.10.53 smbprn.00000001 Linux - -

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