centOS 7 部署samba
2024-08-25 17:47:36
部署samba
**每个用户有自己的目录,可以浏览内容,也可以删除**
清空防火墙规则
[root@bogon ~]# iptables -F
安装samba
[root@bogon ~]# yum -y install samba
配置文件在/etc/samba/smb.conf
添加用户
[root@bogon samba]# useradd smbtest
[root@bogon samba]# usermod -s /sbin/nologin smbtest
[root@bogon samba]# smbpasswd -a smbtest
New SMB password:
Retype new SMB password:
Added user smbtest.
重启服务测试连接
[root@bogon samba]# systemctl restart smb
smb删除用户用以下命令:
smbpasswd -x smbtest
**所有的用户共享一个目录,只能浏览内容,不能删**
新建share目录,修改权限
[root@bogon samba]# mkdir /share
[root@bogon samba]# ll /share -d
drwxr-xr-x 2 root root 6 6月 1 00:53 /share
[root@bogon samba]# chmod o+w /share
[root@bogon samba]# ll -d /share
drwxr-xrwx 2 root root 6 6月 1 00:53 /share
修改配置,重启服务
[root@bogon samba]# vim smb.conf
[public]
comment = Public Stuff
path = /share
public = yes
writable = no
printable = no
write list = lucaq,lucaqsmb,smbtest [root@bogon samba]# systemctl restart smb
windows下测试:
net use
net use * /del
\\192.168.16.99\public
最新文章
- 札记:Fragment基础
- 微信小程序火车票查询 直取12306数据
- Lintcode: Remove Node in Binary Search Tree
- Easyui扩展或者重载(方法和属性)
- SQLserver查询数据库所有字段-表名
- BZOJ 2456
- libevent 初试
- STM32库函数实现方法
- Unity NGUI Tween的用法
- jQuery手机发送验证码倒计时代码
- css sprites 图标合并工具网站
- C++简单交换堆排序的代码
- Oracle 11g设置IP访问限制
- 爬虫——cookies池的搭建
- 当我们用自定义的类对象作为key时,我们必须在程序中覆盖HashCode()和equals()。
- sonar gitlab+jenkins配置
- response的contentType的类型值Response.ContentType
- 利用monkeyrunner、python脚本来做多设备多apk适配ui界面截屏的自动化测试
- Alpha冲刺(3/10)——追光的人
- 微信小程序/支付宝小程序 WxParse解析富文本(html)代码