zoukankan      html  css  js  c++  java
  • The Guideline of Setting Up Samba Server on linux(Ubuntu)

    The Guideline of Setting Up Samba Server on linux(Ubuntu)

    1. From terminate command window, install the samba package with follow command:

    Sudo apt-get install samba

    2. Edit the samba config with follow command:

    Sudo vim /etc/samba/smb.conf

    Add follow content for share folder myshare:

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

            workgroup = WORKGROUP                                                 //设置工作组名称

            server string = %h server (Samba, Ubuntu)                  //服务器说明

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

            comment = my test share folder                                       //注释说明

            path = /home/mostlee/testshare                                    //共享目录的路径

            public = yes                                                                                //是yes/否no公开共享,若为否则进行身份验证(只有当security = share 时此项才起

    writable = yes                                                        //是yes/否no不以只读方式共享当与read only发生冲突时,无视read only

    browseable = yes                                                   //是yes/否no在浏览资源中显示共享目录,若为否则必须指定共享路径才能存取

    guest ok = yes                                                                    //是yes/否no公开共享,若为否则进行身份验证(只有当security = share 时此项才起作用)

    Share to everyone sample:

                                           

    Share the folder for shareuser access with account/password:

     

    3.  Restart samba service with follow command:

    Sudo service smbd restart

       The command to view the smbd service status:

    Sudo service smbd status

    4. Add a user to access the share folder:

    useradd testshareuser

    smbpasswd –a testshareuser                                                     set the user password.

    5. Access the share from windows os:

       View the linux machine’s ipaddress with ifconfig [eth0]

       Maybe need to close the firewall, command like:

       Service iptables stop

    Now, we should access the share folder, in file explorer from windows machine,

    url : \192.168.1.100myshare

     

    • For machine in azure, should add endpoints for accessing samba from the virtual machine.
      1. Login the https://portal.azure.com with manage account.
      2. Open the target VM’s property page from Virtual Machines section.
      3. On property page, open the networking page by clicking Networking under Settings node.
      4. Add inbound port rules for enpoints(137,138,139,445)
    1.  
    • Some other general command for adding share user:

                smbpasswd –a username                      add user

                smbpasswd –d username                      disable the user

                smbpasswd –e username                      enable the user

                smbpasswd –n username                      set the user’s password to empty

                smbpasswd –x username                      delete the user

  • 相关阅读:
    AI Dropout
    笔记2 区块链
    Visual Studio的下载安装
    第48课 thinkphp5添加商品库
    一个手机号可以注册绑定5个百度网盘,永久2T
    第39-43课 thinkphp5完成商品会员价格功能(后置勾子afterInsert)
    第37课 thinkphp5添加商品基本信息及通过前置钩子上传商品主图 模型事件(勾子函数)
    php中 为什么验证码 必须要开启 ob_clean 才可以显示
    网站同一用户只能在同一个地方登录
    微信小程序第3课 目录结构及小知识点
  • 原文地址:https://www.cnblogs.com/lijavasy/p/10115693.html
Copyright © 2011-2022 走看看