一、首先查看是否安装samba,命令为:rpm -qa | grep samba
出现如下包表示已经安装,否则没有安装
samba-winbind-clients-3.5.10-125.el6.i686
samba-client-3.5.10-125.el6.i686
samba-common-3.5.10-125.el6.i686
samba-3.5.10-125.el6.i686
samba-3.5.10-125.el6.i686.rpm
samba-common-3.5.10-125.el6.i686.rpm
samba-client-3.5.10-125.el6.i686.rpm
命令为:rpm -ivh samba-common-3.5.10-125.el6.i686.rpm
2、然后依次安装另外两个,显示信息如下:
三、接下来就是配置samba,这个比较简单不再赘述
配置Samba
/etc/samba/smb.conf
[root]
comment = Root Directories
browseable = yes
writable = yes
path = /
valid user = pm
添加一个用户名
useradd smb // 添加smb系统用户
smbpasswd -a pm // 修改密码
重启samba
/etc/init.d/smb restart
注意:
1、记得重启网络 : /etc/init.d/network restart
2、启动samba : service smb start
3、在ping的通的前提下做这些事情!
四、
在linux的Samba服务中,不能创建文件夹和文本文件_解决办法
关闭SElinux可以解决: 关闭 SElinux方法:
使用文本编辑工具打开 /etc/selinux/config: vi /etc/selinux/config 找到这段: 找到这段:
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=enforcing
把 SELINUX=enforcing 注释掉:#SELINUX=enforcing ,然后新加一行为:SELINUX=disabled 保存,关闭。 重启系统。
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. #SELINUX=enforcing SELINUX=disabled
记住还需要修改相应的目录权限
五、开机自启动samba