Debian系统Samba配置

Debian系统上配置Samba

参考链接:
https://www.cnblogs.com/xycoin/p/6095688.html

系统及架构:
Linux Matrix_061001 5.10.42-yocto-standard #1 Thu Jun 3 07:00:52 UTC 2021 armv7l armv7l armv7l GNU/Linux

samba概述:
Samba是一套使用SMB(Server Message Block)协议的应用程序,通过支持这个协议,Samba允许Linux服务器与Windows系统之间进行通信,使跨平台的互访成为可能。Samba采用C/S模式,其工作机制是让NetBIOS( Windows 网上邻居的通信协议)和SMB两个协议运行于TCP/IP通信协议之上,并且用NetBEUI协议让Windows在“网上邻居”中能浏览Linux服务器。

Samba服务器包括两个后台应用程序:Smbd 和 Nmbd。Smbd 是Samba的核心,主要负责建立 Linux Samba服务器与Samba客户机之间的对话,验证用户身份并提供对文件和打印系统的访问;Nmbd主要负责对外发布Linux Samba服务器可以提供的NetBIOS名称和浏览服务,使Windows用户可以在“网上邻居”中浏览Linux Samba服务器中共享的资源。另外Samba还包括一些管理工具,如 smb-client,smbmount,testparm,Smbpasswd 等程序。

Samba服务器可实现如下功能:WINS和DNS服务;网络浏览服务;Linux和Windows域之间的认证和授权;UNICODE字符集和域名映射;满足CIFS协议的UNIX共享等。

注意: Samba 服务器的配置文件叫 smb.conf, 位于 /etc/samba/目录下。在 /usr/share/samba/目录下也有一个 smb.conf 文件> 备份,如果你在配置服务器时把 /etc/samba/smb.conf改乱了,就可以用该文件来恢复到初始状态。启动脚本位于 /etc/init.d/ 目> 录下,叫 samba,如果修改了 smb.conf 配置文件,可用 #/etc/init.d/samba restart 命令重启 Samba 服务

一、samba安装

[root@Matrix_061001 samba]apt-get update
[root@Matrix_061001 samba]apt-get install samba

二、创建共享目录以及修改权限

[root@Matrix_061001 samba]mkdir /home/guest			
[root@Matrix_061001 samba]chmod 777 /home/guest

三、创建samba用户

#创建samba用户
[root@Matrix_061001 samba]touch /etc/samba/smbpasswd		
[root@Matrix_061001 samba]smbpasswd -a yuan 
New SMB password:
Retype new SMB password:
Added user yuan.
[root@Matrix_061001 samba]

#查看当前samba用户
[root@Matrix_061001 samba]pdbedit -L
root:0:root
yuan:1002:
[root@Matrix_061001 samba]

#删除samba用户
[root@Matrix_061001 samba]smbpasswd -x yuan  
Deleted user yuan.
[root@Matrix_061001 samba]

四、配置smb.conf文件

[root@Matrix_061001 samba]#cat /etc/samba/smb.conf
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash) 
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not made any basic syntactic errors. 
#
#======================= Global Settings =====================================
[global]

# workgroup = NT-Domain-Name or Workgroup-Name
   workgroup = MYGROUP

# server string is the equivalent of the NT Description field
   server string = Samba Server

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
;   hosts allow = 192.168.1. 192.168.2. 127.

# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
   printcap name = /etc/printcap
   load printers = yes

# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
;   printing = bsd

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
;  guest account = pcguest

# this tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
   max log size = 50

# Security mode. Most people will want user level security. See
# security_level.txt for details.
   security = user
  • 3
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值