samba服务

Linux安装Samba服务 Linux系统可通过Samba服务进行文件共享,本文介绍如何安装和配置。 阅读详情

一、samba的作用
samba提供cifs协议来共享文件
可以在linux操作系统与windos操作系统之间来共享文件
1.下载并启动samba
yum install samba samba-common samba-client -y ##安装安装samba及相关组件
systemctl start smb ##启动samba
systemctl stop firewalld.service ##关闭防火墙
2.添加用户
smbpasswd -a 用户 ##添加用户,用户必须是本机存在的用户
pdbedit -x smb用户 #删除smb用户
这里写图片描述
pdbedit -L ##查看samba的用户
这里写图片描述
3.基本应用
smbclient -L //172.25.254.105 -U student ##查看172.25.254.105共享出来的文件,默认共享出来的是用户的家目录
这里写图片描述
smbclient //172.25.254.105/student -U student ##进入172.25.254.105共享的student目录中,可以进行一系列操作
这里写图片描述
4.特殊应用
samba 可以挂载
这里写图片描述
挂载之后就可以实现,存储分离,当我主机1挂载主机2的samba,当我的主机1出现问题后,我的数据还是存在的,这样可以保证我的数据安全
samba的开机自动挂载
配置/etc/fstab文件加入下面语句
//172.25.254.105/student /mnt cifs defaults,username=student,password=westos 0 0 ##开机自动挂载

二、samba的配置
samba的主配置文件为:/etc/samba/smb.conf
要增加发布目录可以在配置文件最后加上下面配置
[WESTOS] ##目录名
comment = share westos ##描述
path = /westos ##目录的绝对路径
编写完成后查看,我们加入的westos分享目录就出来了
这里写图片描述
*应注意selinux的问题
selinux会阻止我们的服务,因为我们所分享的目录与samba所要求的安全上下文不一致,这时我们需要不同的方法来解决这种问题
–当我们共享的是自己建立的目录时,我们可以用更改selinux的安全上下文来取消限制,安全上下文为samba_share_t
semanage fcontext -a -t samba_share_t ‘目录名称(/.*)?’
restorecon -RvvF 目录名称
–当我们共享的时系统的目录时,如果更改安全山下文就会使其他的应用没法使用,这时我们需要更改selinux对应用的布尔值,来取消其对应用的限制
getsebool -a | grep samba ##查看samba有那些权限可以开放
setsebool -P 权限名 on | off ##开关权限

三、用户访问控制
1.ip登陆控制
用户黑名单hosts deny = ip ##只允许某ip登陆
用户白名单hosts allow = ip ##只禁止某ip登陆
这里写图片描述
测试
这里写图片描述
2.用户登陆控制
在配置文件的分享块里,增加
valid users = student ##只允许sudent用户登陆,studnet用户时samba中存在的用户
valid users = @student ##允许student用户组登陆
valid users = +student ##允许studnet用户组登陆
这里写图片描述
测试
这里写图片描述
3.匿名用户登陆
编写配置文件添加
guest ok = no ##添加到分享块里
map to guest = bad user
这里写图片描述
这里写图片描述
测试 输入密码时直接敲回车
这里写图片描述
4.读写控制
首先更改写入目录的权限使其可写
chmod o+w /mnt
更改selinux相关布尔值
setsebool -P samba_export_all_rw on
更改配置文件/etc/samba/smb.conf
writable = yes ##分享块中添加
这里写图片描述
测试
未更改权限之前
这里写图片描述
更改权限后
这里写图片描述
指定用户可写
更改配置文件,添加
write list = studnet ##跟上面一样+ @ 表示组
这里写图片描述
测试,其他用户登陆后,不能写入
这里写图片描述

四、多用户挂载
在客户端创建编辑
vim /root/smbpasswd ##文件名随便
chmod 600 /root/smbpasswd ##密码文件一般使用600
yum install cifs-utils -y ##下载插件
mount -o credentials=/root/smbpasswd,multiuser,sec=ntlmssp //172.25.254.105/student /mnt/
credentials ##指定挂载时用到的密码文件
multiuser ##支持多用户认证
sec=ntlmssp ##认证方式为标准smb认证方式
这里写图片描述
su - student 切换到普通用户
cd /mnt
ls: cannot access /mnt: Permission denied ##因为没有smb的认证所以不能查看smb的共享
cifscreds add -u student 172.25.254.105
使用此命令来认证
这里写图片描述

CentOS部署Samba服务_centos samba 这里要注意,我们虽然在samba中设置了写权限,但是我们去不能在Windows下删除或新建文件,这是因为我们的Windows属于客户端,客户端远程登录samba服务访问/company目录,我们可以通过ll命令查看/company目录的权限,这个目录是属于root用户,root组的,而我们的客户端属于其它用户,权限是r-x。Samba网盘,Samba是一个网络服务器,用于Linux和Windows之间共享文件,Samba一般装在Linux系统中作为服务器,为Windows用户提供网盘。 阅读详情

相关推荐

S7-1200 Modbus TCP客户端配置实战:从基础设置到数据交互详解

本文详细介绍了S7-1200 Modbus TCP客户端的配置方法,从基础设置到数据交互的完整流程。涵盖硬件准备、TIA Portal配置、MB_CLIENT指令参数详解、数据缓冲区管理及实战测试,帮助工程师快速掌握西门子PLC与Modbus TCP通信的关键技术。

fire9的博客 311

samba一般安装(Ubuntu)

samba在线安装与配置 或者 3、查看samba版本和状态 结果: 具体更新内容同博客Ubuntu离线安装samba与配置(.tar方式安装)

lucky_chaichai的博客 2484

MatGPT:在MATLAB中集成AI助手,实现代码生成与调试自动化

大语言模型(LLM)通过API接口为开发者提供了强大的自然语言理解和代码生成能力,其核心原理是基于海量数据训练的Transformer架构,能够根据上下文预测并生成连贯的文本或代码。这一技术为工程实践带来了革命性价值,特别是在科学计算和算法开发领域,能够显著提升开发效率,实现智能化的代码辅助和问题解答。在实际应用中,开发者常需在IDE与AI工具间频繁切换,导致工作流中断。MatGPT作为一个开源项目,通过深度集成ChatGPT API到MATLAB环境,有效解决了这一痛点。它支持多模态输入、预设提示词管理和

weixin_42388898的博客 501

如何在 Windows 中检测、启用和禁用 SMBv1、SMBv2 和 SMBv3

摘要 本文介绍如何在 SMB 客户端和服务器组件上启用和禁用服务器消息块(SMB)版本1(SMBv1)、SMB 版本2(SMBv2)和 SMB 版本3(SMBv3)。 重要 建议你不要禁用 SMBv2或 SMBv3。仅将 SMBv2 或 SMBv3 作为临时故障排除度量值禁用。不要让 SMBv2 或 SMBv3 处于禁用状态。 在 Windows 7 和 Windows Server 2008 R2 中,禁用 SMBv2 将停用以下功能: 在 Windows 8、Windows 8.1、W...

allway2的博客 1万+

力科PCIE协议分析仪summit T3-8使用指南

力科PCIE协议分析仪summit T3-8使用指南

wq897387的专栏 2007

Cadence SPB16. 6 安装流程

1.首先下载CadenceAllegroSPBorCAD16.6安装包 下载之后运行其中的setup.exe,然后先安装第一项LicenseManager 一直按next或install, 直到被询问license时,单击cancel,然后选是和finish。 2,安装Product Installtion 直接点next跳过这一步 安装完成后,点Exit退出 3.按ctrl+alt+delete打开任务管...

wangjie36的博客 5153

Smbclient介绍

1      Smbclient介绍 Smbclient(samba client)是基于SMB协议的,用于存取共享目标的客户端程序。 SMB协议介绍: 服务器信息块(SMB)协议是一种 IBM 协议,用于在计算机间共享文件、打印机、串口等。SMB 协议可以用在因特网的TCP/IP协议之上,也可以用在其它网络协议如 IPX 和 NetBEUI 之上。 SMB 一种客户机/服务器、请求/响应

679

手把手教你学Simulink--控制执行场景实例:基于Simulink的智能车辆自动紧急制动(AEB)仿真

本文完成了基于 Simulink 的智能车辆自动紧急制动(AEB),实现了:✅ 构建前车急刹与静止障碍物典型场景✅ 设计基于 TTC 的三级 AEB 决策逻辑✅ 验证在高风险场景下有效避免碰撞✅ 掌握从风险评估到制动执行的完整安全链✅ 为ADAS 主动安全功能开发奠定基础。

MHD0815的博客 237

Windows 10以后的版本默认不会启用SMBv1

Windows 10 Fall Creators Update 和 Windows Server 版本 1709 (RS3),默认情况下不再安装服务器消息块版本 1 (SMBv1) 网络协议。

par@ish的博客 2830

添加USB wifi驱动到RK3568

在日常开发中我们经常需要用到wifi功能,一般来说soc厂家都会事先做好了几个厂家的wifi驱动在内核源码目录下,我们只需要按原理图配置对应的设备树即可。常用的wifi的接口有:USBSDIOPCIE下面来介绍这这种接口是如何使用wifi芯片。提示:以下是本篇文章正文内容,下面案例可供参考本小节介绍了一个配置一个USBwifi驱动的整个流程,并没有介绍到SDIO,下小节基于AP6256介绍如何使用。

qq_24093081的博客 2050

【脑电信号】脑电信号EEG形态学滤波处理【含Matlab源码 4023期】

脑电信号EEG形态学滤波处理 完整的代码,包运行;运行操作视频见优快云资源!适合小白!

订阅付费专栏Matlab(奶茶价版),可赠送奶茶价版付费专栏指定代码1份; 823

Samba服务

介绍了Samba的出现及其作用。详细说明了Samba服务的组成和服务配置文件以及常用的配置参数。Samba服务的用户认证共享及匿名共享的部署流程,Windows系统与Linux系统共享。

m0_50111062的博客 3727

华为自研 ERP、Oracle EBS 与 SAP 上线时系统配置思路设计差异深度分析

本文对比分析了华为自研ERP、Oracle EBS和SAP S/4HANA三大ERP系统在上线配置思路上的核心差异。从架构设计看,华为采用分布式微服务架构,SAP采用分层服务架构,Oracle采用集中式一体化架构;在模块配置上,华为以业务场景为导向,SAP基于行业模板,Oracle强调模块独立性;数据迁移方面,华为侧重业务规则清洗,SAP注重数据质量监控,Oracle依赖标准化工具;流程适配上,华为系统随流程调整,SAP在框架内优化,Oracle需定制开发;定制开发模式差异明显,华为采用插件化扩展,SAP使

金牌架构师 1455

Linux安装samba服务

一:使用到的Linux指令 1:检查是否安装samba了服务 rpm -qa |grep samba 2:安装samba服务 mkdir /iso 建立子目录 mount /dev/cdrom /iso 挂载光盘 vim /etc/yum.repos.d/dvd.repo 配置yum源 [dvd] name=dvd baseurl=file:///iso gpgcheck.........

孤夜的博客 1万+

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

samba 服务搭建

前言:Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成。原本SMB协议是windows和windows(网上邻居)之间分享资源的一种协议。Linux找到微软,也想把该协议用在window和Linux的文件共享上,可微软没有同意,于是Linux通过逆向方法实现了SMB协议,为了与SMB区分并将其取名为SAMBA协议。 下面开始samba服务器的安装及使用吧Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成。SMB(Ser

weixin_56270746的博客 8726

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

linux怎么开启samba服务,LINUX开启SAMBA服务

这里将告诉您LINUX开启SAMBA服务,教程操作步骤:samba,用于网络文件共享,类似于nfs,samba多用于win和linux之间linux之间多用nfsc/s架构smb协议samba主要是两个服务,核心启动服务SMB,监听139TCP端口,NMB服务类似DSN功能,如果不启,只能以ip来访问,监听137 138UDP端口使用yum -y install samba然后防火墙systemc...

weixin_32808905的博客 3582

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Linux下的samba服务配置详解

Linux下的samba服务配置详解一、Samba介绍二、Samba工具及特性三、搭建环境介绍四、Samba配置步骤1.服务端操作2.在客户端操作五、测试用户的权限情况 一、Samba介绍 1.SMB(Server Messages Block,信息服务块)是一种在局域网上共享文件和打印机的一种通信协议,它为局域网内的不同计算机之间提供文件及打印机等资源的共享服务。 2.Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成。 3.其他相关概念: CIFS:commo

jks212454的博客 7504

samba 服务的搭建

Samba 服务的搭建 什么是samba? Samba是在Linux和UNIX系统上实现SMB协议的一个免费软件,由服务器及客户端程序构成。 Samba,是种自由软件,用来让UNIX系列的操作系统与微软Windows操作系统的SMB/CIFS(Server Message Block/Common Internet File System)网络协定做连结。在目前的版本(v3),不仅可存取

HuddHeaven的专栏 1539
上一篇: anpache服务
下一篇: python简单脚本1
python_bobo
博客等级 码龄9年 15粉丝 45原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值