samba 配置

来源:互联网 发布:云南农业大学网络考试 编辑:程序博客网 时间:2024/05/23 14:22
安装:
rpm -qa | grep samba 查看是否安装相应文件:
     samba-winbind-3.5.4-68.el6.i686
     samba-winbind-clients-3.5.4-68.el6.i686
     samba-3.5.4-68.el6.i686
     samba-common-3.5.4-68.el6.i686
     samba-client-3.5.4-68.el6.i686
安装命令:rpm -ivh 包名 (mount ios文件后,在里边有安装包)

配置:
     /etc/samba 路径下配置smb.conf文件,只需在共享部分添加:
     [root]
               comment = Root Directories
               browseable = yes
               writable = yes
               path = /
               valid users = root

     samba添加访问用户和密码(如果共享方式为user则需要这一步)
     smbpasswd -a root #root为用户名

禁止防火墙:setup firewall  configuration
关闭selinux:修改配置文件 /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=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

开机自启动:
     setup-》系统服务-》找到smb

samba本机测试命令:
     smbclient //serverip/root
     smbclient //serverip/root -U username

这样,windows下,使用root可以访问全部 /根目录下文件。
0 0