samba是Linux系统上的一种文件共享协议,可以实现Windows系统访问Linux系统上的共享资源,现在介绍一下如何在Ubuntu 14.04上安装和配置samba,以及ubuntu上挂载windows共享盘的方法。此方法仅适用于ubuntu,windows两台不同的电脑,在局域网下。如果是windows与windows下虚拟机中的ubuntu(同一台电脑),在虚拟机中设置即可。
1. 在ubuntu下打开终端,并输入:sudo apt-get update
2. 安装samba服务,在终端中输入:sudo apt-get install samba samba-common进行安装
3. 建立你想共享出去的文件夹,在终端中执行:mkdir /home/folder_name (folder_name是你想共享出去的文件夹名称)
4. samba安装好之后,会在/etc/samba/文件夹下有一个smb.conf文件,此文件是samba的一个配置文件。
5. 编辑此文件,用gedit或者vi都可以,在终端中执行:sudo gedit /etc/samba/smb.conf 或者执行:sudo vi /etc/samba/smb.conf
6. 在其中添加一行: security = user ,添加这一行的目的在于,只有输入账号和密码才能访问此文件夹。添加的位置如下:
#### Debugging/Accounting ####
# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m
# Cap the size of the individual log files (in KiB).
max log size = 1000
security = user
# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no
# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following pa

最低0.47元/天 解锁文章
6930

被折叠的 条评论
为什么被折叠?



