http://blog.csdn.net/fly_qj/article/details/21744797

1.先要安装Samba

sudo apt-get install samba openssh-server

2.编译Samba配置文件

sudo vi /etc/samba/smb.conf

找到[homes]项,此项默认是注释掉的,取消其注释,然后修改其具体内容,修改成如下:

[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 =0755#建议将权限修改成0755,这样其它用户只是不能修改
# 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, \\server\username 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 \\server\username
# The following parameter makes sure that only "username" can connect
#
# This might need tweaking when using external authentication schemes
valid users =%S #本行需要取消注释,%s是指登陆用户可以访问

如上修改完成后wq保存退出!

3. 重启samba服务:

sudo service restart smbd

sudo service restart nmbd

这里重启我用的是

sudo /etc/init.d/smbd restart

sudo /etc/init.d/nmbd restart

4. 增加一个现有用户的对应samba帐号:

如我已经有一个用户叫liuyan,现在给liuyan开通samba帐号:

sudo smbpasswd -aliuyan

根据提示输入两次密码即可(这个密码就是系统登陆账户liuyan的密码)

5.现在可以测试了,在Window下输入samba地址尝试登录:

\\10.0.0.2\reddy

6.此时windows应该会弹出窗口要求输入用户名和密码了,输入吧。Enjoy!如果没有提示输入密码,请重启Windows系统

注:本文章对Ubuntu_64_15.10设置成功,window输入密码后可以读、写文件。

  对Ubuntu_64_14.04设置失败了,window输入密码后,不能对共享文件夹进行读、写操作。

更多相关文章

  1. 在centos中安装了mysql5.7之后解决不知道随机的密码的问题
  2. ubuntu修改根用户密码
  3. 解决useradd 用户后没有添加用户Home目录的情况,Linux改变文件或
  4. mysql数据库忘记ROOT密码时的解决办法
  5. mysql5.6和5.7的权限密码设置
  6. Mysql5.7.10版本安装后空密码登录,退出后提示密码错误连接不上解
  7. MySQL忘记密码破解密码的方法
  8. 如何使用来自其他模型的信息来注释查询集,或者在Django Rest Fram
  9. MySQL root 用户密码重置

随机推荐

  1. 值类型对象的两种表示形式
  2. net 使用 data.oracleclient 出现的错误
  3. 经典的IoC/DI容器--StructureMap
  4. 最新版近乎v5.0新型社区发布介绍
  5. 什么是构造器?引用类型是什么?
  6. 用Shape做动画的实例详解
  7. ASP.NET MVC 遇到JSON循环调用的问题应该
  8. asp .net 面试题及答案分享
  9. angularjs是怎么为ng-click事件传递参数
  10. WPF核心的技术--数据绑定