SAMBA 服务器安装与配置

#!/bin/bash

#SAMBA  window co-connect linux

#SAMBA  NETBIOS

#SAMBA nmbd:137 138  smbd:139 445

#samba samba-client samba-common /etc/samba/smb.conf /etc/samba/imhosts/etc/sysconfig/samba /etc/samba/smbusers

#/var/lib/samba/private/passdb.tdb,secrets.tdb

#smbd nmbd tdbdump tdbtool smbstatus smbpasswd pdbedit testparm smbclientnmblookup smbtree

yum install -y samba netbios;

#log file=   max log size=rotate...

#security=share(no pass) user(passdb backend=) domain(password server=IP)

#path,browseable,writable,create mode,directory mode,writelist=@

#

配置不用帐号密码的文件夹

cd /etc/samba

cp smb.conf smb.conf.raw

vim /etc/samba/smb.conf

[global]

   workgroup = vbirdhouse

   netbios name = vbirdserver

   server string = This is test


   unix charset = utf8

   dos charset = cp36

   log file = /var/log/samba/log.%m

   max log size = 50


   security=user

   map to guest =Bad User

   load printers = no

[temp]

   comment = Templrary file space

   path = /tmp

   writable = yes

   browseable = yes

   guest ok = yes


##########end smb.conf

testparm -v  #test conf

/etc/init.d/smb start

/etc/init.d/nmb start

chkconfig smb on

chkconfig nmb on

###################

客户端

yum install -y cifs*;

smbclient -L //127.0.0.1

mount -t cifs //127.0.0.1/temp /mnt

#####################################

添加有用户名和密码的共享

cd /etc/samba

cp smb.conf smb.conf.raw

vim /etc/samba/smb.conf

[global]

   workgroup = vbirdhouse

   netbios name = vbirdserver

   server string = This is test


   unix charset = utf8

   dos charset = cp36

   log file = /var/log/samba/log.%m

   max log size = 50


   security=user

   passdb backend = tdbsam

   load printers = no

[homes]

   comment = sxxx

   browseable = no

   writeable = yes

   create mode = 0664

   directory mode = 0775

[project]

   comment = xxxx

   path = /home/project

   browseable = yes

   writeable = yes

   write list = @users

###########

useradd -G users smb1;

useradd -G users smb2;

useradd -G users smb3;

echo 1234|passwd --stdin smb1;

echo 1234|passwd --stdin smb2;

echo 1234|passwd --stdin smb3;

#

往SMDB中添加帐号密码,该帐号密码必须在/etc/passwd

pdbedit -a -u smb1;

pdbedit -a -u smb2;

pdbedit -a -u smb3;

pdbedit -L #list

pdbedit -r -u smb1   #

修改用户信息

pdbedit -x -u smb1   #

删除用户

#

客户端挂载

mount -t cifs //192.168.10.54/smb1 /mnt -o username=smb1

##################printer

lsusb

ll /dev/usb/lp0

echo "xxx"> /dev/usb/lp0

yum groupinstall -y "Print Server";

vim /etc/cups/cups.conf

Listen 0.0.0.0:631

Allow From 192.168.10.0/24

/etc/init.d/cups start

chkconfig cups on

https://ip:631

#smb.conf

加入打印机支持

vim smb.conf

[global]

   load printers=yes

   cups options = raw

   printcap name=cups

   printing =cups

[printers]

   comment=xx

   path=/var/spool/samba

   browseable=no

   guest ok=no

   writeable=no

   printable=yes

############################


���c�'

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 1. Samba简介 Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构...
    garyond阅读 14,885评论 2 29
  • 案例一、公司现有一个工作组workgroup,需要添加samba服务器作为文件服务器,并发布共享目录/home/s...
    SkTj阅读 5,161评论 1 1
  • 转载:blog.51cto.com/yuanbin/115761 Samba配置文件常用参数详解 Samba的主配...
    一掠而过阅读 8,514评论 3 2
  • smb(samba): 1、用于linux和windows之间的文件共享,可以实现匿名用户和本地用户之间的文件共享...
    柒夏锦阅读 4,650评论 0 4
  • 1.SAMBA服务简介 (1)SAMBA的功能: • 共享文件和打印,实现在线编辑• 实现登录SAMBA用户的身份...
    尛尛大尹阅读 4,870评论 0 1

友情链接更多精彩内容