1.检查是否安装有samba
rpm -qa | grep "samba"
2.如果没有安装
yum install samba
3.找到配置文件/etc/samba/smb.conf
①不需要密码的配置文件
[global]
workgroup = WORKGROUP
server string = Samba Server Version %v
hosts allow = 127. 192.168.0. 192.168.1. 192.168.2.
log file = /var/log/samba/log.%m
max log size = 50
security = share
cups options = raw
[share]
comment = tx share
path = /home/data/txshare
public = yes
read only = yes
writable = yes
browseable = yes
注意:如果win7访问linux上samba共享不能成功的话,提示错误(0x80070035 找不到网络路径解决方法)
请检查开启“TCP/IP NetBIOS Helper”(在windows服务中有),在进行测试
②加密码认证的配置文件
[global]
workgroup = WORKGROUP
server string = Samba Server Version %v
hosts allow = 127. 192.168.0. 192.168.1. 192.168.2.
log file = /var/log/samba/log.%m
max log size = 50
security = user
passdb backend = smbpasswd
smb passwd file = /etc/samba/smbpasswd
cups options = raw
[TXshare]
comment = tx share
path = /home/data/txshare
public = yes
read only = yes
writable = yes
browseable = yes
添加账号如下
useradd -s /sbin/nologin -d /dev/null tx
添加smb账号之前,必须要添加系统账号
smbpasswd -a tx
(
smbpasswd -a 用户名 #添加一个samba用户
smbpasswd -d 用户名 #禁用一个samba用户
smbpasswd -e 用户名 #恢复一个samba用户
smbpasswd -x 用户名 #删除一个samba用户
)本文出自 “记录点滴” 博客,请务必保留此出处http://caozm.blog.51cto.com/1118764/1360798
原文:http://caozm.blog.51cto.com/1118764/1360798