设置树莓派为打印服务器,开启无线打印

Posted 饕盡天下

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了设置树莓派为打印服务器,开启无线打印相关的知识,希望对你有一定的参考价值。

# 1.开启raspberry的SSH,11月15号发布的版本默认不开启.
# 2.启动root用户,执行此命令后系统会提示输入两遍的root密码,输入你想设的密码即可,然后在执行
sudo passwd root

# 解锁root账户
sudo passwd --unlock root

# 3.更新软件
sudo apt-get update -y
sudo apt-get upgrade -y

# 4.安装CPUS以及相关服务
sudo apt-get install cups -y
sudo apt-get install samba -y

# 5.将默认pi用户添加到group中
sudo usermod -a -G lpadmin pi

# 6.停止cups服务并更新配置文件
sudo service cups stop

# 7.备份配置文件
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak

设置cupsd.config文件,修改部分如下 :

#
# Sample configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
#

# Log general information in error_log - change "warn" to "debug"
# for troubleshooting...
LogLevel warn

# Deactivate CUPS‘ internal logrotating, as we provide a better one, especially
# LogLevel debug2 gets usable now
MaxLogSize 0

# Only listen for connections from the local machine.
Listen *:631
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseLocalProtocols dnssd
BrowseAllow all

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Web interface setting...
WebInterface Yes

# 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>

 

# 启动printer
sudo service cups start

# 设置静态ip
sudo vi /etc/dhcpcd.conf

# 添加如下内容后重启
interface wlan0
static ip_address=10.0.0.x/24
static routers=10.0.0.1
static domain_name_server=8.8.8.8

 




以上是关于设置树莓派为打印服务器,开启无线打印的主要内容,如果未能解决你的问题,请参考以下文章

电信自带无线光猫怎样连接打印机?

MacBook M1 连惠打印机连接不上?

2. 树莓派:通过树莓派的RJ45上网

树莓派之打印服务器配置

1. 树莓派:eth桥接到wlan口,共享上网

Zebra638 打印机设置和Wifi无线打印设置