linux学习之samba安装问题详解

来源:互联网 发布:mac有自带的画图软件吗 编辑:程序博客网 时间:2024/06/14 20:07

一、首先查看是否安装samba,命令为:rpm -qa | grep samba                                                                         

出现如下包表示已经安装,否则没有安装

samba-winbind-clients-3.5.10-125.el6.i686samba-client-3.5.10-125.el6.i686samba-common-3.5.10-125.el6.i686samba-3.5.10-125.el6.i686

二、安装samba服务器,找到这三个软件包

samba-3.5.10-125.el6.i686.rpmsamba-common-3.5.10-125.el6.i686.rpmsamba-client-3.5.10-125.el6.i686.rpm

1、先装samba-common-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

1.执行“chkconfig --list”指令,检测smb service是否已经在Fedora的service列表中.
 
2. 如果没有,用“chkconfig --add smb”添加smb service.
 
3. 用"chkconfig --level 35 smb on”指令把samba service在第三和第五运行级别打开 (不知道具体细节没有关系)。 这样,每次Fedora重新启动都会自动开启samba service.

原创粉丝点击