文件共享:FTP
不能在线编辑 -> NFS
不能跨平台 --> Samba
linux --NFS --
network file system
window --CIFS -- Common Internet
File System 网络邻居
1991.Andrew Tridgell -- > SMB :Server Message Block
:Samba为注册商标
作用:1.文件服务器
2.编修www网页数据
3.打印机服务器
NetBIOS:NetWork Basic Input/Output System:
IBM局域网通讯协议,无法跨越路由,Windows网络邻居沿用,同一个Workgroup,通过NetBIOS Name识别不同计算机
NetBIOS
over TCP/IP 可以跨路由。
nmbd:管理工作组,NEtBIOS name解析,UDP,prot 137.138
smbd:管理文件资源,目录或打印机,数据传输TCP 139
445
联机模式:
peer/peer(Workgroup model) 对等模式
每台计算机都保存有账号密码。
domain model:账号密码统一用PDC服务器管理。
安装软件:
samba-common-3.0.33-3.37.el5.x86_64.rpm
服务器和客户端使用的数据,smb.conf testparm
samba-3.0.33-3.37.el5.x86_64.rpm
服务器主程序,smbd,nmbd,
samba-client-3.0.33-3.37.el5.x86_64.rpm
客户端程序,mount.cifs
配置文件:
/etc/samba/smb.conf
/etc/samba/lmhosts
/etc/samba/smbusers
/etc/samba/passdb.tdb, secrets.tdb
3.0以后使用TDB(Trivial
DataBase)数据库存储账号密码。
/usr/share/doc/samba- samba所有技术手册
/etc/sysconfig/samba
服务器程序:
/usr/sbin/nmbd
/usr/sbin/smbd
/usr/bin/tdbdump
查看数据库内容
/usr/bin/tdbtool进入数据库借口直接修改账号密码参数。(需安装tdb-tools软件)
/usr/bin/smbstatus 列出Samba联机状况
/usr/bin/smbpasswd,pdbedit 管理Samba账号密码数据
/usr/bin/testparm: 检验smb.conf 语法。
客户端程序
/sbin/mount.cifs 挂载远程文件资源
/usr/bin/smbclient 产看远程文件资源
/usr/bin/nmblookup 查看NetBIOS name
/usr/bin/smbtree 列出工作组与计算机名称树状分布图
共享:
#==================== Global Settings
===========================
[global]
workgroup = LY_GROUP
server string
= liaoyi‘s Samba Server Version %v
netbios name = LY_SMB
# --------------------- Logging Options ---------------------------
#
#
Log File let you specify where to put logs and how to split them up.
#
#
Max Log Size let you specify the max size log files should reach
# logs split per
machine
log file =
/var/log/samba/%m.log
# max 50KB
per log file, then rotate
max log
size = 50
# ------------------ Standalone Server Options ----------------------
security = share
# ------------------ Printing Options ----------------------
#============================ Share Definitions
=====================
load printers =
no
#liaoyi‘s share
director
[smb_share]
comment =
LY‘s file share
path =
/tmp/smb_share
public =
yes
guest ok =
yes
writable =
yes
browseable = yes
chmod 777 home chmod 777 share
setenforce 0
设置安全级别为0;
smbclient -L //127.0.0.1
mount -t cifs //127.0.0.1/temp/smb_share /mnt
用户+share+public
# ---------------- Standalone Server Options ------------------------
security =
user
passdb backend = tdbsam
#====================== Share Definitions ==============================
[homes]
comment = Home
Directories
browseable =
no
writable =
yes
valid users =
%S
create mode =
0644
directory mode =
0775
; valid users = MYDOMAIN\%S
[part_share]
comment = group
share
path =
/secbox/plain/group_share/group1001
browseable =
yes
writable =
yes
write list = @group1
[all_public]
comment = all
users share
path =
/secbox/plain/all_public
public =
yes
guest ok =
yes
writable =
yes
browseable = yes
net use * /del /y
net use \\samba文件服务器IP地址\IPC$ /delete
:>net use 显示帐号
:>net use \\192.168.1.102\account
/delete删除