samba配置

 

 

samba配置:

sudo ufw disable      //关闭防火墙 
sudo ufw enable        //开启
sudo ufw status   //查看状态 

sudo vim /etc/samba/smb.conf

 

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# 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 most of which 
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# 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]## Browsing/Identification #### Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
# wins support = no# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no#### Networking ##### The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes#### Debugging/Accounting ##### This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m# Cap the size of the individual log files (in KiB).
max log size = 1000# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d####### Authentication ######## Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller". 
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
server role = standalone server# If you are using encrypted passwords, Samba will need to know what
# password database type you are using. 
passdb backend = tdbsamobey pam restrictions = yes# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user########## Domains ############
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or 'domain logons' is set 
## It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u# This allows machine accounts to be created on the domain controller via the 
# SAMR RPC pipe. 
# The following assumes a "machines" group exists on the system
; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe. 
; add group script = /usr/sbin/addgroup --force-badname %g############ Misc ############# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash# Setup usershare options to enable non-root users to share folders
# with the net usershare command.# Maximum number of usershare. 0 (default) means that usershare is disabled.
; usershare max shares = 100# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes#======================= Share Definitions =======================# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
; read only = yes# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
; create mask = 0700# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only "username"
# can connect to \\server\username
# This might need tweaking when using external authentication schemes
; valid users = %S# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
; write list = root, @lpadmin
[tftpboot]
path=/tftpboot
available = yes
browseable = yes
public = yes
writable = yes[opt]
path=/opt
available = yes
browseable = yes
public = yes
writable = yes

 

转载于:https://www.cnblogs.com/Lxk0825/p/10516659.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/569660.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

21.Merge Two Sorted Lists 、23. Merge k Sorted Lists

21.Merge Two Sorted Lists 初始化一个指针作为开头&#xff0c;然后返回这个指针的next class Solution { public:ListNode* mergeTwoLists(ListNode* l1, ListNode* l2) {ListNode* dummy new ListNode(-1);ListNode* p dummy;while(l1 && l2){if(l1->val < …

求最大公约数----辗转相除法

辗转相除法&#xff08;求最大公倍数&#xff09; 一般写法&#xff1a; public class Main {public static void main(String[] args) {System.out.println(gcd(18, 2));}private static int gcd(int a, int b) {// TODO Auto-generated method stubwhile (b ! 0) {int c a…

使用kubeadm安装kubernetes高可用集群

kubeadm安装kubernetes高可用集群搭建 第一步&#xff1a;首先搭建etcd集群yum install -y etcd配置文件 /etc/etcd/etcd.confETCD_NAMEinfra1 ETCD_DATA_DIR"/var/lib/etcd" ETCD_LISTEN_PEER_URLS"https://172.20.0.113:2380" ETCD_LISTEN_CLIENT_URLS&q…

蓝桥杯第七届国赛JAVA真题----平方末尾

平方末尾 能够表示为某个整数的平方的数字称为“平方数” 比如&#xff0c;25,64 虽然无法立即说出某个数是平方数&#xff0c;但经常可以断定某个数不是平方数。 因为平方数的末位只可能是&#xff1a;[0, 1, 4, 5, 6, 9] 这6个数字中的某个。 所以&#xff0c;432543533…

紫书 团队队列(队列)

1.用两个队列来维护成员&#xff0c;一个队列维护队伍编号&#xff0c;一个队列数组维护每个队伍的成员 ps: 紫书p118 #include <bits/stdc.h> using namespace std;int t, k, x, y; queue<int> allq; queue<int> q[12]; vector<int> v; string s1&quo…

蓝桥杯第七届国赛JAVA真题----七星填数

七星填数 如图【图1.png】所示。 在七角星的14个节点上填入1~14 的数字&#xff0c;不重复&#xff0c;不遗漏。 要求每条直线上的四个数字之和必须相等。 图中已经给出了3个数字。 请计算其它位置要填充的数字&#xff0c;答案唯一。 填好后&#xff0c;请提交绿色节点的4个…

Codeforces Round 546 (Div. 2)

layout: post title: Codeforces Round 546 (Div. 2) author: "luowentaoaa" catalog: true tags: mathjax: true - codeforces - 贪心 - 数学 - 线段树 传送门 A - Nastya Is Reading a Book (签到) 题意 给出每一章的页数范围&#xff0c;然后告诉你当前看到那一页…

洛谷 P1219 ---- 八皇后

题目描述 检查一个如下的6 x 6的跳棋棋盘&#xff0c;有六个棋子被放置在棋盘上&#xff0c;使得每行、每列有且只有一个&#xff0c;每条对角线(包括两条主对角线的所有平行线)上至多有一个棋子。 上面的布局可以用序列2 4 6 1 3 5来描述&#xff0c;第i个数字表示在第i行…

PXE(preboot execution environment):【网络】预启动执行环节:引导 live光盘 ubuntu livecd 16.4:成功...

default menu.c32label ubuntu menu label ubuntu (version 16.04) kernel ub1604/casper/vmlinuz append root/dev/nfs bootcasper netbootnfs nfsroot192.168.56.1:/e/_temp/ub1604 initrdub1604/casper/initrd quiet splash --# 关键是搭建nfs相应的服务器器并export解压后的…

PHP实现多文件上传

PHP文件上传流程 单击提交按钮&#xff0c;浏览器用户将包含上传文件的表单数据提交给PHP处理程序Web服务器和PHP预处理器首先判断表单数据的大小是否超过php.ini配置文件中的post_max_size选项设置的上限值。 若超过&#xff0c;PHP处理程序将无法得到任何表单数据&#xff0…

bzoj5324:[Jxoi2018]守卫

传送门 首先考虑定下一个端点&#xff0c;然后剩下的就可以递推了 一开始想的是定下左端点&#xff0c;然后预处理出位置最远能看到的位置&#xff0c;后来发现时间GG了 看题解发现定右端点优秀得多 记录下当前\(r\)最远能看到的位置\(p\)&#xff0c;能看到\([p,r]\)一共需要几…

蓝桥杯第八届省赛JAVA真题----分巧克力

标题&#xff1a; 分巧克力 儿童节那天有K位小朋友到小明家做客。小明拿出了珍藏的巧克力招待小朋友们。 小明一共有N块巧克力&#xff0c;其中第i块是Hi x Wi的方格组成的长方形。 为了公平起见&#xff0c;小明需要从这 N 块巧克力中切出K块巧克力分给小朋友们。切出的巧克…

蓝桥杯第八届省赛JAVA真题----油漆面积

标题&#xff1a;油漆面积 X星球的一批考古机器人正在一片废墟上考古。 该区域的地面坚硬如石、平整如镜。 管理人员为方便&#xff0c;建立了标准的直角坐标系。 每个机器人都各有特长、身怀绝技。它们感兴趣的内容也不相同。 经过各种测量&#xff0c;每个机器人都会报告…

练习2——顺序表

//实现顺序表基本功能&#xff0c;然两个顺序表相并 #include <iostream> #include <stdlib.h> using namespace std; typedef int T; class SeqList{T *data;int MaxSize;int last; public:SeqList(int sz);~SeqList(){delete [] data;}int Length() const {retur…

docker占满linux磁盘根目录的解决办法

一、磁盘根目录被占满 [testlocalhost docker]$ df -lh Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos-root 50G 50G 0G 100% / devtmpfs 7.7G 0 7.7G 0% /dev tmpfs 7.8G 0 7.8G 0…

蓝桥杯第八届省赛JAVA真题----包子凑数

标题&#xff1a;包子凑数 小明几乎每天早晨都会在一家包子铺吃早餐。他发现这家包子铺有N种蒸笼&#xff0c;其中第i种蒸笼恰好能放Ai个包子。每种蒸笼都有非常多笼&#xff0c;可以认为是无限笼。 每当有顾客想买X个包子&#xff0c;卖包子的大叔就会迅速选出若干笼包子来&…

蓝桥杯第八届省赛JAVA真题----字母组串

标题&#xff1a;字母组串 由 A,B,C 这3个字母就可以组成许多串。 比如&#xff1a;”A”,”AB”,”ABC”,”ABA”,”AACBB” …. 现在&#xff0c;小明正在思考一个问题&#xff1a; 如果每个字母的个数有限定&#xff0c;能组成多少个已知长度的串呢&#xff1f; 他请好…

蓝桥杯第八届省赛JAVA真题----9数算式

标题&#xff1a;9数算式 观察如下的算式&#xff1a; 9213 x 85674 789314562 左边的乘数和被乘数正好用到了1~9的所有数字&#xff0c;每个1次。 而乘积恰好也是用到了1~9的所有数字&#xff0c;并且每个1次。 请你借助计算机的强大计算能力&#xff0c;找出满足如上要…

《剑指offer》第五十三题(数组中数值和下标相等的元素)

// 面试题53&#xff08;三&#xff09;&#xff1a;数组中数值和下标相等的元素 // 题目&#xff1a;假设一个单调递增的数组里的每个元素都是整数并且是唯一的。请编程实 // 现一个函数找出数组中任意一个数值等于其下标的元素。例如&#xff0c;在数组{-3, -1, // 1, 3, 5}中…

Mysql 外键创建失败原因

最近在学习PHP&#xff0c;在用mysql创建表的时候总是创建不出来&#xff0c;我用的是Navicat做的&#xff0c;虽然建不出来外键&#xff0c;但是会创建出来一个索引&#xff0c;后来才明白&#xff0c;一定要有了对应的索引才能创建外键。