Redhat7 配置samba
安装:
# yuminstall samba samba-common samba-client
启动服务:
#systemctl start smb
#systemctl start nmb
#systemctl enable smb
#systemctl enable nmb
配置文件路径:/etc/samba/smb.conf
samba端口:TCP:139,445 UDP:137,138
装好后默认是user模式(貌似redhat7去掉了share模式)
security= user,ads,domain/server
创建samba账号(须有对应本地账号):
#smbpasswd –a aa
输入密码
修改samba密码命令:
#smbpasswd aa (用户自己改直接敲smbpasswd即可)
删除samba账号:
#smbpasswd –e aa
开放防火墙:
#firewall-cmd –permanent –add-service=smb
#firewall-cmd –permanent –add-service=smb
#firewall-cmd –reload
此时用账号访问samba直接进的家目录(默认设置)
但登录后发现进不去,须设置下selinux
#setsebool –P samba_enable_home_dirs on (smb.conf里有关于selinux的提示)
查看账号对应共享:
# smbclient–L //10.0.0.2 -U aa%123456 (aa为账号,123456为密码,中间是%)
允许匿名访问是在security =user下添加map to guest = bad user
本文出自 “linux” 博客,请务必保留此出处http://yangzhiming.blog.51cto.com/4849999/1721600
原文:http://yangzhiming.blog.51cto.com/4849999/1721600