設置樹莓派為打印服務器,開啟無線打印


# 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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM