Samba服务器配置
1、 在linux安装samba
2、 建立共享目录
如:mkdir /opt/share,或者用linux用户主目录。
3、 修改/etc/samba/smb.conf配置文件
例如下面简单配置
(1) ==============Global Settings ===============================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = WORKGROUP #windows主机工作组
# server string is the equivalent of the NT Description field
server string = Samba Server
security = user # security = share
hosts allow = 192.168.1. 192.168.6. 192.168.5. 127.#允许访问samba的IP段
log file = /var/log/samba/%m.log #samba日志
# Put a capping on the size of the log files (in Kb).
max log size = 50
dns proxy = no
(2)================== Share Definitions ==============================
[homes]
comment = Home Directories
browseable = yes
writable = yes
# This one is useful for people to share files
[tmp]
comment = Temporary file space
path = /tmp
browseable = yes
read only = no
writeable = yes
public = yes
# A publicly accessible directory, but read only, except for people in
# the "staff" group
[public]
comment = Public Stuff
path = /home/samba
public = yes
writable = yes
printable = no
write list = root
#private dir define
[daviddir]
comment = david's Service
path = /home/david
valid users = david
public = yes
writable = yes
printable = no设置samba密码文件
4、 将/etc/passwd里的用户添加到smbpasswd文件中
Cat /etc/passwd |mksmbpasswd.sh >/etc/samba/smbpasswd
5、修改smbpasswd属主与权限
Chown root.root /etc/samba/smbpasswd
Chmod 500 /etc/samba
Chmod 600 /etc/samba/smbpasswd
6、 修改samba口令
例如修改root口令
Smbpasswd root
7、 启动samba
a) 测试samba配置文件
testparm
b) 启动samba
Service smb start
c) 查看服务器共享资源
Smbclient -L localhost
d) 列出资源使用状态
smbstatus
1、 在linux安装samba
2、 建立共享目录
如:mkdir /opt/share,或者用linux用户主目录。
3、 修改/etc/samba/smb.conf配置文件
例如下面简单配置
(1) ==============Global Settings ===============================
[global]
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
workgroup = WORKGROUP #windows主机工作组
# server string is the equivalent of the NT Description field
server string = Samba Server
security = user # security = share
hosts allow = 192.168.1. 192.168.6. 192.168.5. 127.#允许访问samba的IP段
log file = /var/log/samba/%m.log #samba日志
# Put a capping on the size of the log files (in Kb).
max log size = 50
dns proxy = no
(2)================== Share Definitions ==============================
[homes]
comment = Home Directories
browseable = yes
writable = yes
# This one is useful for people to share files
[tmp]
comment = Temporary file space
path = /tmp
browseable = yes
read only = no
writeable = yes
public = yes
# A publicly accessible directory, but read only, except for people in
# the "staff" group
[public]
comment = Public Stuff
path = /home/samba
public = yes
writable = yes
printable = no
write list = root
#private dir define
[daviddir]
comment = david's Service
path = /home/david
valid users = david
public = yes
writable = yes
printable = no设置samba密码文件
4、 将/etc/passwd里的用户添加到smbpasswd文件中
Cat /etc/passwd |mksmbpasswd.sh >/etc/samba/smbpasswd
5、修改smbpasswd属主与权限
Chown root.root /etc/samba/smbpasswd
Chmod 500 /etc/samba
Chmod 600 /etc/samba/smbpasswd
6、 修改samba口令
例如修改root口令
Smbpasswd root
7、 启动samba
a) 测试samba配置文件
testparm
b) 启动samba
Service smb start
c) 查看服务器共享资源
Smbclient -L localhost
d) 列出资源使用状态
smbstatus