第一步,安装相关软件
1 2013-04-10_01:22:27 service iptables stop
2 2013-04-10_01:22:32 setenforce 0
3 2013-04-10_01:22:55 yum remove `rpm -qa|grep samba`
4 2013-04-10_01:23:41 yum install samba4*
5 2013-04-10_01:25:20 cd /tmp
6 2013-04-10_01:25:24 wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
7 2013-04-10_01:25:50 tar zxf foo2zjs.tar.gz
8 2013-04-10_01:25:57 cd foo2zjs
9 2013-04-10_01:26:14 make
10 2013-04-10_01:26:36 make install
11 2013-04-10_01:26:49 make install-hotplug
12 2013-04-10_01:26:57 make cups
13 2013-04-10_01:27:17 ln -s `which smbspool` /usr/lib/cups/backend/smb
第二步,使用cups添加打印机,以及从Windows XP提交驱动到samba服务器
1 2013-04-10_01:48:38 service smb start
2 2013-04-10_01:48:45 smbpasswd -a root
3 2013-04-10_01:49:13 net rpc rights grant "localhost\root" SePrintOperatorPrivilege -U localhost/root #赋权,打印机管理员
4 2013-04-10_01:50:23 vi p.sh
5 2013-04-10_01:50:31 sh p.sh
6 2013-04-10_01:51:12 vi /etc/samba/smb.conf
7 2013-04-10_01:53:35 cd /var/lib/samba/
8 2013-04-10_01:53:41 ll -d drivers/
9 2013-04-10_01:54:24 service smb restart
10 2013-04-10_02:01:57 ll -d drivers/
11 2013-04-10_02:02:07 chmod 777 drivers/ #这不是必须的,
12 2013-04-10_02:02:34 chmod 755 drivers/ #因为上面不是必须的,若没执行上面的那条,这条也不用执行
13 2013-04-10_02:02:37 ll -d drivers/
14 2013-04-10_02:02:51 vi /etc/samba/smb.conf
15 2013-04-10_02:03:09 service smb reload #此处,reload试过,发现依然不能提交驱动
16 2013-04-10_02:03:24 service smb restart #restart后,可以提交驱动给samba
17 2013-04-10_02:10:32 cd /var/lib/samba/drivers/W32X86/
18 2013-04-10_02:10:34 LS #这是错误的命令,不用
19 2013-04-10_02:10:36 ls #看看这里有没有什么文件
20 2013-04-10_02:10:39 cd 3 #进入目录
21 2013-04-10_02:10:40 ls #查看目录内容,会发现Windows XP上传的驱动文件
p.sh
######################################
BASEDIR=/srv/samba/Printer_drivers
for i in COLOR IA64 W32ALPHA W32MIPS W32PPC W32X86/{2,3} WIN40 x64; do
mkdir -p $BASEDIR/$i;
done
######################################
[root@localhost 3]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
workgroup = MYGROUP
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
idmap config * : backend = tdb
cups options = raw
[homes]
comment = Home Directories
read only = No
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
print ok = Yes
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = root
read only = No
参考:https://wiki.samba.org/index.php/Setup_a_printer_share
转载于:https://blog.51cto.com/nicecoffee/1215143