当前位置:   article > 正文

ubuntu 下创建和访问共享文件夹_ubuntu访问共享文件夹域名

ubuntu访问共享文件夹域名

1.创建共享文件夹:

1.ubuntu12.04 版本:
$ sudo apt-get install samba4  
$ sudo mkdir -p /home/share //创建共享文件夹 
$ sudo chmod 777 /home/share  
$ sudo cp /etc/samba/smb.conf /etc/samba/smb-bk.conf  
$ sudo vim /etc/samba/smb.conf  //编辑samba配置文件,添加如下代码
....
# ----------------------- Standalone Server Options ------------------------
#
# Scurity can be set to user, share(deprecated) or server(deprecated)
#
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
#       security = user
#免密码访问
        security = share
....
 [share]
       path = /home/android8/Documents
       available = yes
       browseable = yes
       public = yes
       writable = yes

 [zhanglei_share]
       path = /home/zhanglei/share
       available = yes
       browseable = yes
       public = yes
       writable = yes
 $ sudo /etc/init.d/smbd restart
 
 2.ubuntu14.04版本:
 $ sudo apt-get install samba samba-common
 $ mkdir -p share
 $ sudo chown nobody:nogroup ./share
 $ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bk
 $ sudo vim /etc/samba/smb.conf

[Anonymous]
       comment = Anonymous share access
       path = /shares/anonymous
       browsable = yes
       writable = yes
       guest ok = yes
       read only = no
       force user = nobody
       force group = nogroup
 $ sudo service smbd restart
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50

2:访问共享文件夹
ubuntu 12.04LTS已经不支持smbfs文件系统,所以不能用mount -smbfs 来映射windows共享文件夹。

常见有两种方法

1.terminal下

mount //192.168.0.88/share  -o user=DOMIAN\\xxx,pass=xxx /mnt/share

注:其中192.168.0.88是windows主机名称,share是其共享文件夹名。domain是windows主机域名,必须大写。 

2. GUI方式
  • 1
  • 2
  • 3
  • 4
  • 5

主文件夹下,按Ctrl+l,输入smb://192.168.0.88,按提示输入登陆账户,然后就可以访问了。

2.ubuntu 16.04设置

1.安装samba服务
sudo apt-get install samba
sudo smbpasswd -a $USER
sudo service smbd restart
2.设置共享文件夹
打开文件管理器,选择需要共享的文件夹,右键,选择“Local Network Share”,点击“Create Share”,完成
3.测试
点击文件管理器“Connect to Server”
输入网址“smb://127.0.0.1”
选择“Registered User”
输入用户名,密码,点击"Connect"
完成

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号