smaba
来源:互联网 发布:java数组删除指定元素 编辑:程序博客网 时间:2024/06/03 15:02
samba
1.samba作用
提供cifs协议实现共享文件
2.安装
yum install samba samba-comon samba-client -y
systemctl start smb nmb
systemctl enable smb nmb
2.添加smb用户
smb用户必须为本地用户
smbpasswd -a student
New SMB password: #输入smb当前用户密码
Retype new SMB password: #确认密码
pdbedit -L #查看smb用户信息
pdbedit -x smb用户 #删除smb用户
setsebool -P samba_enable_home_dirs on #在selinux中设定smb用户可以访问自己的家目录
4.共享目录的基本设定
vim /etc/samba/smb.conf
[westos] 共享名称
comment = 对共享目录的描述
path = 共享目录的绝对路径
测试 :smbclient -L //172.25.254.218 -U student
当共享目录为用户自建立目录时
semanage fcontext -a -t samba_share_t '目录名称(/.*)?'
restorecon -RvvF 目录名称
共享目录
setsebool -P samba_export_all_ro on #只读共享
isetsebool -P samba_export_all_rw on #读写共享
测试: smbclient //172.25.254.218/westos -U student
5.samba的配置参数
#匿名用户访问
125 map to guest = bad user
guest ok = yes
#访问控制
hosts allow = ip #仅允许
hosts deny = ip #仅拒绝
valid users = #当前共享的有效用户
valid users = westos #当前共享的有效用户为westos
valid users = @westos #当前共享的有效用户为westos组
valid users = +westos #当前共享的有效用户为westos组
useradd westos -s /sbin/nologin
smbpasswd -a westos
usermod -G westos student
#读写控制
所有用户均可写
chmod o+w /mnt
setsebool -P samba_export_all_rw on
vim /etc/samba/smb.conf
writable = yes
设定指定用户可写
write list = student #可写用户
write list = +studnt ##可写用户组
write list = @student ##可写用户组
在client上
vim /root/haha
username=student
password=chen
chmod 600 /root/haha
yum install cifs-utils -y
mount -o credentials=/root/haha,multiuser,sec=ntlmssp //172.25.254.218/haha /mnt
#credentials=/root/haha 指定挂载时所用到的用户文件
#multiuser 支持多用户认证
#sec=ntlmssp 认证方式为标准smb认证方式
su kiosk
#因为没有做smb的认证所以无法访问smb共享
[student@desktop70 mnt]$ ls /mnt
ls: cannot access /mnt: Permission denied
cifscreds add -u westos 172.25.254.218
Password: #smb用户westos的密码
ls /mnt
1.samba作用
提供cifs协议实现共享文件
2.安装
yum install samba samba-comon samba-client -y
systemctl start smb nmb
systemctl enable smb nmb
2.添加smb用户
smb用户必须为本地用户
smbpasswd -a student
New SMB password: #输入smb当前用户密码
Retype new SMB password: #确认密码
pdbedit -L #查看smb用户信息
pdbedit -x smb用户 #删除smb用户
setsebool -P samba_enable_home_dirs on #在selinux中设定smb用户可以访问自己的家目录
4.共享目录的基本设定
vim /etc/samba/smb.conf
[westos] 共享名称
comment = 对共享目录的描述
path = 共享目录的绝对路径
测试 :smbclient -L //172.25.254.218 -U student
当共享目录为用户自建立目录时
semanage fcontext -a -t samba_share_t '目录名称(/.*)?'
restorecon -RvvF 目录名称
共享目录
setsebool -P samba_export_all_ro on #只读共享
isetsebool -P samba_export_all_rw on #读写共享
测试: smbclient //172.25.254.218/westos -U student
5.samba的配置参数
#匿名用户访问
125 map to guest = bad user
guest ok = yes
#访问控制
hosts allow = ip #仅允许
hosts deny = ip #仅拒绝
valid users = #当前共享的有效用户
valid users = westos #当前共享的有效用户为westos
valid users = @westos #当前共享的有效用户为westos组
valid users = +westos #当前共享的有效用户为westos组
useradd westos -s /sbin/nologin
smbpasswd -a westos
usermod -G westos student
#读写控制
所有用户均可写
chmod o+w /mnt
setsebool -P samba_export_all_rw on
vim /etc/samba/smb.conf
writable = yes
设定指定用户可写
write list = student #可写用户
write list = +studnt ##可写用户组
write list = @student ##可写用户组
admin users = westso #共享的超级用户指定
在client上
vim /root/haha
username=student
password=chen
chmod 600 /root/haha
yum install cifs-utils -y
mount -o credentials=/root/haha,multiuser,sec=ntlmssp //172.25.254.218/haha /mnt
#credentials=/root/haha 指定挂载时所用到的用户文件
#multiuser 支持多用户认证
#sec=ntlmssp 认证方式为标准smb认证方式
su kiosk
#因为没有做smb的认证所以无法访问smb共享
[student@desktop70 mnt]$ ls /mnt
ls: cannot access /mnt: Permission denied
cifscreds add -u westos 172.25.254.218
Password: #smb用户westos的密码
ls /mnt
阅读全文
0 0
- smaba
- smaba
- smaba安装
- ubuntu smaba服务配置
- ubuntu 安装smaba服务
- smaba服务(一)
- Smaba服务器配置
- ftp、nfs、smaba
- Ubuntu下搭建smaba
- smaba服务器搭建
- win7 / xp+smaba+redht9.0
- 在ubuntu中使用smaba
- 服务篇二---文件服务器smaba
- CentOS配置smaba与Windows共享文件
- CentOS配置smaba与Windows共享文件
- CentOS配置smaba与Windows共享文件
- CentOS配置smaba与Windows共享文件
- CentOS配置smaba与Windows共享文件
- 常见异常处理
- Flurry 统计(国际版)
- USACO-Section1.4 Arithmetic Progressions
- 用Windows远程桌面连接树莓派的方法
- Flyway Validate failed:migration checksum mismatch for migration 1.0.0003
- smaba
- Git建立github远程仓库
- 汇编语言: 串处理指令
- linux下C语言多线程编程实例——经典实例写的不好
- express和koa中的超时处理
- 顶点颜色交融效果
- 阿里云相关配置
- Android Studio 图片选择器
- jdbc