zoukankan      html  css  js  c++  java
  • Ubuntu14.04使用samba服务器共享Home目录

    这里记录一下,以Ubuntu 14.04为例。

    1.安装samba服务器。

    sudo apt-get install samba

    2.修改配置文件

    sudo vim /etc/samba/smb.conf

    然后找到home目录共享的部分,大概是190-214行,将前面的注释去掉,如下:

    # Un-comment the following (and tweak the other settings below to suit)
    # to enable the default home directory shares. This will share each
    # user's home directory as \serverusername
    [homes]
       comment = Home Directories
       browseable = yes
    
    # By default, the home directories are exported read-only. Change the
    # next parameter to 'no' if you want to be able to write to them.
       read only = no
    
    # File creation mask is set to 0700 for security reasons. If you want to
    # create files with group=rw permissions, set next parameter to 0775.
       create mask = 0666
    
    # Directory creation mask is set to 0700 for security reasons. If you want to
    # create dirs. with group=rw permissions, set next parameter to 0775.
       directory mask = 0755
    
    # By default, \serverusername shares can be connected to by anyone
    # with access to the samba server.
    # Un-comment the following parameter to make sure that only "username"
    # can connect to \serverusername
    # This might need tweaking when using external authentication schemes
       valid users = %S

    这里的掩码我稍微做了修改。

    3.修改samba用户密码。

    例如我的用户名是wing,那么需要创建一个相应的密码,用于samba共享,这个密码跟系统账户那个是不同的。

    sudo smbpasswd -a wing

    然后重启samba服务

    sudo service smbd restart

    4.在windows的资源管理器中打开\192.168.1.6homes(这里我的IP为192.168.1.6),输入用户名和密码(注意是刚才设置的samba用户密码),就可以看到设置成功。

    如果感觉不太方便,可以把这个地址映射为文件夹或者一个虚拟的磁盘。

  • 相关阅读:
    [Beta阶段]发布说明
    [技术博客]使用微信机器人监听群内招聘信息的过程及遇到的问题
    [Beta阶段]第十次Scrum Meeting
    [Beta阶段]第九次Scrum Meeting
    [技术博客]django连接mysql数据库的方法及部分问题的解决方法
    python学习06循环
    python学习05条件分支
    python学习04数据
    python学习03字符串基本操作
    python学习01python入门一
  • 原文地址:https://www.cnblogs.com/inevermore/p/4199820.html
Copyright © 2011-2022 走看看