linux共享打印机smb,centos7 安装cups+smb共享打印机

yum  install  -y cups sambavim /etc/cups/cupsd.confListen 0.0.0.0:631                    #0.0.0.0表示监听所有ip

Listen /var/run/cups/cups.sock

Browsing On

BrowseLocalProtocols dnssd

DefaultAuthType Basic

WebInterface Yes

# Restrict access to the server...

#Order allow,deny

Order deny,allow

deny all

allow from 192.168.5.0/24             #允许访问服务页面ip段或ip

# Restrict access to the admin pages...

#Order allow,deny

Order deny,allow

deny all

allow from 192.168.5.0/24              #允许访问管理页面ip段或ip

AuthType Default

Require user @SYSTEM

这里我关闭selinux  和 firewalldsystemctl stop firewalld.service

systemctl disable firewalld.service

setenforce 0vim /etc/selinux/config# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=disabled                                             #永久关闭

# SELINUXTYPE= can take one of three two values:

#     targeted - Targeted processes are protected,

#     minimum - Modification of targeted policy. Only selected processes are protected.

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

配置smbvim /etc/samba/smb.conf[global]

workgroup = WORKGROUP                               #工作组

security = user                                     #验证方式

interfaces = lo  192.168.5.209/24 192.168.0.209/24  #samba 监听ip

passdb backend = tdbsam

server string = Samba Server%v

printing = cups              #打印机

printcap name = cups         #名称

netbios name = centos

load printers = yes          #加载打印

cups options = raw

map to guest = bad user      #匿名登录

[homes]

comment = Home Directories

valid users = %S, %D%w%S

browseable = No

read only = No

inherit acls = Yes

[printers]

comment = All Printers

path = /var/spool/samba

printable = Yes

create mask = 0600

browseable = No

writable = no

guest ok =yes

[print$]

comment = Printer Drivers

path = /var/lib/samba/drivers

write list = root

create mask = 0664

directory mask = 0775

[Public]                     #公共文件夹

path = /data/public

writable = yes

browsable = yes

guest ok = yes

guest only = yes

create mode = 0777

directory mode = 0777

启动服务systemctl start smb.service

systemctl start cups.service

systemctl enable smb.service

systemctl enable cups.service

若有其他问题可试试systemctl start smb nmb

添加打印机

然后测试

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在CentOS下安装CUPS来实现局域网共享HP1020打印机的步骤如下: 1. 首先,确保CUPS安装在CentOS系统中。可以使用以下命令来安装CUPS: ``` sudo yum install cups ``` 2. 安装完成后,启动CUPS服务并设置其在系统启动时自动启动。可以使用以下命令来完成此操作: ``` sudo systemctl start cups sudo systemctl enable cups ``` 3. 验证CUPS服务是否成功启动。可以在Web浏览器中输入以下地址来访问CUPS管理界面: ``` http://localhost:631/ ``` 4. 在CUPS管理界面中,单击"Administration"选项卡,然后选择"Add Printer"来添加打印机。 5. 在"Add Printer"页面中,选择要添加打印机品牌和型号。选择正确的驱动程序以确保打印机能够正常工作。 6. 如果在列表中没有找到适合您的打印机型号的驱动程序,则可以尝试通过“Generic”或“Postscript”驱动程序进行设置。 7. 在接下来的步骤中,您需要提供有关您的打印机的一些基本信息,例如打印机名称、描述和位置。您还可以选择共享打印机以供其他计算机访问。 8. 确认设置后,单击"Continue"按钮并按照提示完成添加打印机的设置。 9. 在有多台计算机的局域网中,其他计算机可以通过访问CUPS管理界面来查找并添加共享打印机。其他计算机只需安装适用于其操作系统的CUPS客户端。 通过上述步骤,您应该能够在CentOS系统上安装CUPS并实现局域网共享HP1020打印机
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值