zoukankan      html  css  js  c++  java
  • samba 服务器搭建

    环境准备

    centos 7: server 192.168.152.99   client :windows系统

    关闭防火墙和selinux机制

    目的

    实现linux系统与windows系统的文件共享

    查看是否有samba包

    [root@ /root] alibaba cloud
    #rpm -qa |grep samba

    安装

    [root@ /root] alibaba cloud
    #yum install samba samba-common samba-client -y 

    启动及开机自启

    [root@ /root] alibaba cloud
    #systemctl start smb

    [root@ /root] alibaba cloud
    #systemctl enable smb修改smb服务配置文件  /etc/samba/smb.conf

    [global]                    //设置samba服务整体环境

    workgroup = WORKGROUP            //设置工作组名称
    server string = Samba Server Version %v                 //服务器说明

    [gongxiang]                     //共享目录的名称


    comment = Public stuff               //注释说明 
    path = /usr/local/gongxiang                 //共享目录的路径
    public = yes                   //是yes/否no公开共享,若为否则进行身份验证(只有当security = share 时此项才起作用)
    writeable = yes                //是yes/否no不以只读方式共享当与read only发生冲突时,无视read only
    browseable = yes                 //是yes/否no在浏览资源中显示共享目录,若为否则必须指定共享路径才能存取
    guest ok = yes                //是yes/否no公开共享,若为否则进行身份验证(只有当security = share 时此项才起作用)

    创建一个非登陆用户

    useradd -s /sbin/nologin  gongxiang

    smbpasswd -a gongxiang    //设置共享用户的密码

    修改共享目录的权限

    chown    gongxiang    /usr/local/gongxiang/

    windows访问

    补充:

    使用smbpasswd添加共享用户的常用方法:

        smbpasswd -a 添加用户(被添加用户必须是系统用户)

        smbpasswd -d 冻结用户 (这个用户不能用了)

        smbpasswd -e 恢复用户 (将冻结的用户解冻)

        smbpasswd -n 将用户密码设置为空 

        smbpasswd -x 删除用户

  • 相关阅读:
    Windows Server 2008 R2 实现多用户连接远程桌面
    增加远程登录用户登陆个数
    Win2008R2PHP5.4环境加载Zend模块
    Windows 和  Linux 下 禁止ping的方法
    Windows 2003 FastCgi安装环境
    Windows2008下搭建NFS实现windows空间提供linux使用
    Spring + JdbcTemplate + JdbcDaoSupport examples
    Spring Object/XML mapping example
    Spring AOP + AspectJ in XML configuration example
    Spring AOP + AspectJ annotation example
  • 原文地址:https://www.cnblogs.com/linux-error/p/9295349.html
Copyright © 2011-2022 走看看