Linux安装配置samba

yum update
yum install -y samba samba-client samba-common cifs-utils

smb.conf的配置例子如下

 #cat  /etc/samba/smb.conf
 [global]
 workgroup = WORKGROUP
 server string = x200
 dns proxy = no
# interfaces = eth0
 syslog = 0
 browsable = yes
 map to guest = bad user
 nt pipe support = no
 encrypt passwords = true
 passdb backend = tdbsam
 obey pam restrictions = yes
 unix password sync = no
 netbios name = MY_SHARE_SERVER

#== Share Definitions ===
[share]  
path = /opt/share_folder
valid users=share_user
directory mask = 0755
create mask = 0664
writable = yes
guest ok = no
read only = no
public = no

配置好smb.conf后需要创建目录和设置用户密码

useradd share_user #创建Linux用户
mkdir /opt/share_folder #创建目录
chown -R share_user:share_user  /opt/share_folder #设置文件夹归属权限
chmod 755 /opt/share_folder    #设置文件夹读写权限
smbpasswd -a share_user #设置密码

最后启动smb后测试。

添加新评论 »