配置文件定义一个共享目录:
[node1]
comment=shared node1
path=/sambashared/node1
writable = yes
write list = samba
测试配置文件语法,并显示最终配置:
[root@sherry node1]# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[node1]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
[global]
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size = 50
client signing = required
idmap config * : backend = tdb
cups options = raw
[homes]
comment = Home Directories
browseable = No
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
print ok = Yes
browseable = No
[node1]
comment = shared node1
path = /sambashared/node1
write list = samba
read only = No
linux client:
[root@marvin node1]# yum -y install samba-client
登入
[root@marvin node1]# smbclient //sherry/node1 -U samba
Enter samba's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23-35.el6_8]
smb: \> put anaconda-ks.cfg
putting file anaconda-ks.cfg as \anaconda-ks.cfg (249.4 kb/s) (average 249.4 kb/s)
smb: \> get a
getting file \a of size 0 as a (0.0 KiloBytes/sec) (average 0.0 KiloBytes/sec)
服务器:
[root@sherry node1]# ll
total 4
-rw-r--r-- 1 root root 0 May 27 11:33 a
-rwxr--r-- 1 samba sherry 1277 May 27 11:38 anaconda-ks.cfg
客户端 挂载到本地:
[root@marvin samba]# yum install cifs-utils -y
[root@marvin samba]# mount -t cifs //sherry/node1 /mnt/samba/node1/ -o username=samba # username=samba,passwd=222222
Password:
[root@marvin node1]# df -h
Filesystem Size Used Avail Use% Mounted on
.......
//sherry/node1 1004M 18M 936M 2% /mnt/samba/node1
over
------------------------------------分割线------------------------------------
如何在Ubuntu 14.04中使用Samba共享文件
VMWare 虚拟机 Ubuntu 双网卡 访问 samba 速度 翻倍
Samba文件共享服务器加入Windows Server 2003域
CentOS 6.2 下Samba 服务的配置
Win7+VMware+Fedora18 Samba服务器的搭建图解
------------------------------------分割线------------------------------------