《快速搭建samba服务器.doc》由会员分享,可在线阅读,更多相关《快速搭建samba服务器.doc(3页珍藏版)》请在金锄头文库上搜索。
1、快速搭建samba服务器 1.首先查看系统是否安装samba服务器rootlocalhost /# rpm -qa |grep samba如果结果为:samba-3.0.23c-2samba-common-3.0.23c-2samba-client-3.0.23c-2表示系统已经安装成功。如果结果为空,则需做以下操作2.挂载iso文件到mnt目录下rootlocalhost /# mount /dev/cdrom /mntmount: block device /dev/cdrom is write-protected, mounting read-onlymount: /dev/cdrom
2、already mounted or /mnt busy挂载成功3.进入CentOS目录rootlocalhost mnt# cd /mnt/CentOS/rootlocalhost CentOS#4.查找目录下是否有我们需要的安装包rootlocalhost CentOS# ls *samba*samba-3.0.23c-2.i386.rpm samba-swat-3.0.23c-2.i386.rpmsamba-client-3.0.23c-2.i386.rpm system-config-samba-1.2.39-1.el5.noarch.rpmsamba-common-3.0.23c-2
3、.i386.rpm我们需要samba-3.0.23c-2.i386.rpm samba-client-3.0.23c-2.i386.rpm samba-common-3.0.23c-2.i386.rpm开始安装rootlocalhost CentOS# rpm -ivh samba*安装完成后,我们需要对samba目录下smb.conf进行简单配置rootlocalhost CentOS# cd /etc/samba/rootlocalhost samba# lslmhosts secrets.tdb smb.conf smbpasswd smbusers进入编辑模式rootlocalhost
4、 samba# vi smb.conf清空smb.conf文件内容,输入:global #全局控制netbios name =myfile #输入/myfile 即可访问(默认是以/加IP方式访问)workgroup=workgroup #和windows在同一个组内server string =sambaserver #共享服务器的描述security=share #以什么形式进行共享(share表示不需要身份验证)file #共享文件名comment=home directories #文件的描述path=/fileserver/file #文件的共享路径public=yes #控制方式w
5、ritable=yes #是否可写browseable=yes #是否可浏览新建目录及文件rootlocalhost /# mkdir -p /fileserver/file赋予权限rootlocalhost /# chmod 777 /fileserver/file重启samba服务器rootlocalhost /# service smb restart关闭 SMB 服务: 确定关闭 NMB 服务: 确定启动 SMB 服务: 确定启动 NMB 服务: 确定在我的电脑开始运行处输入/myfile测试看是否成功设置samba在系统启动是自动运行:方法一:rootlocalhost /# setup选择系统服务,将其中smb勾选即可方法二:rootlocalhost /# chkconfig smb on注意:Samba服务器的默认安全级别为user,表示需要用户名和密码才能访问rootlocalhost /# adduser lyjrootlocalhost /# smbpasswd -a lyjNew SMB password:Retype new SMB password:Added user lyj.添加samba用户成功。