码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-12-11 20:57:28      阅读:246      评论:0      收藏:0      [点我收藏+]

标签:man   sys   用户   esc   location   let   启动   admin   outer   

# 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

 

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

标签:man   sys   用户   esc   location   let   启动   admin   outer   

原文地址:http://www.cnblogs.com/taojintianxia/p/6160287.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!