samba实现Windows主机与Linux服务器之间的资源共享。
1.查看默认安装的samba程序包:
[root@localhost etc]#rpm -qa | grep samba
samba-winbind-clients-3.5.4-68.el6.i686
[root@localhost etc]#
2.安装samba服务
[root@localhost ccc]#rpm -ivh samba-common-3.5.4-68.el6.i686.rpm
warning: samba-common-3.5.4-68.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:samba-common ########################################### [100%]
[root@localhost ccc]# rpm -ivh samba-3.5.4-68.el6.i686.rpm
warning: samba-3.5.4-68.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:samba ########################################### [100%]
[root@localhost ccc]# rpm -ivh samba-client-3.5.4-68.el6.i686.rpm
warning: samba-client-3.5.4-68.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing... ########################################### [100%]
1:samba-client ########################################### [100%]
[root@localhost ccc]# rpm -qa | grep samba
samba-common-3.5.4-68.el6.i686
samba-winbind-clients-3.5.4-68.el6.i686
samba-3.5.4-68.el6.i686
samba-client-3.5.4-68.el6.i686
3.修改配置文件smb.conf
[root@localhost home]#cd /etc/samba
[root@localhost samba]# ls
lmhosts smb.conf smbusers
[root@localhost samba]# cp smb.conf /home/smb.conf.BAK
[root@localhost samba]# vi smb.conf
[global]
# ----------------------- Netwrok Related Options -------------------------
workgroup = MYGROUP
server string = Samba Server Version %v
# ----------------------- Standalone Server Options ------------------------
security = share
[MYGROUP]
path = /home/samba
writable = yes
browseable = yes
guest ok = yes
4.建立相应目录并设置权限
[root@localhost home]# mkdir -p /home/samba
4建立相应目录并授权;
[root@localhost ~]# mkdir -p /opt/linuxsir
uid=99(nobody) gid=99(nobody) groups=99(nobody)
注释:
关于授权nobody,我们先用id命令查看了nobody用户的信息,发现他的用户组也是nobody,我们要以这个为准。有些系统nobody用户组并非是nobody ;
第三步:启动smbd和nmbd服务器;
[root@localhost ~]# nmbd