ubuntu 搭建samba服务

来源:互联网 发布:大数据培训课程体系 编辑:程序博客网 时间:2024/06/04 19:58

windows访问linux可通过搭建samba服务,共享目录

过程:

ubuntu安装sudo apt-get install samba

                 sudo apt-get install smbfs

                 sudo apt-get install smbclient

编辑sudo vi /etc/samba/smb.conf

修改处:

# Change this to the workgroup/NT-domain name your Samba server will part of
   doc charset = UTF-8
   unix charset = UTF-8
   workgroup = WORKGROUP
   netbios name = user_name.wingtech.com

 

 

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
   security = user

 

#======================= Share Definitions =======================

# 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 director as //server/username
[share]
   comment = Home Directories
   path = /home/user_name
   browseable = yes
   public = yes
   writable = yes

 

注意要将该目录用户名和组名改为user_name

  sudo chown user_name /home/share

  sudo chgrp  user_name /home/share

 

建立账号sudo smbpasswd -a user_name

重启下samba服务:sudo service smbd restart

 

此时可以在windows下访问/home/user_name和/home/share这两个文件夹了

可以尝试net use \\IP * /user:user_name;提示输入密码,输入密码,提示命令成功完成证明可以共享了。

例如:net use \\192.168.1.118 * /user:jason


原创粉丝点击