Ubuntu14.04 下安装Samba服务
1.更改linux镜像源:
# vim /etc/apt/sources.list deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
2.更新源列表
apt-get update
apt-get upgrade
3.安装samba
apt-get install samba samba-common
4.新建共享目录并设置权限
mkdir /webser/www/ chmod 777 /webser/www/
5.配置文件smb.conf
vim /etc/samba/smb.conf
在末尾添加:
security = user
[share]
comment = share directory
path = /var/www/html
browsealbe = yes
writable = yes
6.添加共享用户
useradd smbuser
smbpasswd -a smbuser
7.重启smb服务
service smbd restart
8.在windows下 访问共享目录: 在"运行"窗口中输入"\\192.168.38.128"【ubuntu ip】-->回车-->双击打开share-->回车-->输入用户名和密码-->回车-->访问成功。
linux下目录对应是: