samba server 设置
yum install samba.x86_64
systemctl start smb.service
systemctl enable smb.service
samba 使用系统用户共享(用户家目录 )
useradd -s /sbinlogin dafei
pdbedit -a dafei
useradd -s /sbinlogin xiaofu
pdbedit -a xiaofu
pdbedit -L #列出smb用户
pdbedit -x xiaofu #删除用户
smbpasswd sifei #修改smb用户密码
systemctl restart smb.service
setsebool -P samba_enable_home_dirs on
pdbedit -c "[D]" -u tiantian && systemctl restart smb.service
pdbedit -c "[]" -u tiantian && systemctl restart smb.service
windows客户端直接使用uri路径访问即可。
\192.168.1.27
net use * /delete #清空windows缓存
设置samba共享目录:
1 规划目录路径
mkdir /public
chown nobody:nobody /public
2 vi /etcmba/smb.conf #参考书213页
[public]
comment = Public Stuff
path = /public/
public = yes
writable = yes
printable = no
[pub2]
comment = Public Stuff
path = /pub2
browseable = no
public = yes
writable = yes
printable = no
semanage fcontext -a -t public_content_rw_t "/public"
restorecon -F -R -v /public/ #查看目录上下文的修改
ll -Z /public/ -d #查看目录上下文的修改
setsebool -P smbd_anon_write 1 #设置匿名用户可写布尔值
yum install samba.x86_64
systemctl start smb.service
systemctl enable smb.service
samba 使用系统用户共享(用户家目录 )
useradd -s /sbinlogin dafei
pdbedit -a dafei
useradd -s /sbinlogin xiaofu
pdbedit -a xiaofu
pdbedit -L #列出smb用户
pdbedit -x xiaofu #删除用户
smbpasswd sifei #修改smb用户密码
systemctl restart smb.service
setsebool -P samba_enable_home_dirs on
pdbedit -c "[D]" -u tiantian && systemctl restart smb.service
pdbedit -c "[]" -u tiantian && systemctl restart smb.service
windows客户端直接使用uri路径访问即可。
\192.168.1.27
net use * /delete #清空windows缓存
设置samba共享目录:
1 规划目录路径
mkdir /public
chown nobody:nobody /public
2 vi /etcmba/smb.conf #参考书213页
[public]
comment = Public Stuff
path = /public/
public = yes
writable = yes
printable = no
[pub2]
comment = Public Stuff
path = /pub2
browseable = no
public = yes
writable = yes
printable = no
semanage fcontext -a -t public_content_rw_t "/public"
restorecon -F -R -v /public/ #查看目录上下文的修改
ll -Z /public/ -d #查看目录上下文的修改
setsebool -P smbd_anon_write 1 #设置匿名用户可写布尔值