ubunto15.04安装 samba服务实现windows访问

安装samba服务器之后,很方便的实现Windows和Linux进行通信。

安装步骤:

1、在Ubuntu系统下面安装samba服务: nii@ww:~$ sudo apt-get install samba 2、关闭Ubuntu的防火墙

nii@ww:~$ sudo service ufw stop 3、配置smb.conf文件

step 1 先进入配置文件的目录,然后切换到管理员权限 nii@ww:~$ cd /etc/samba/ nii@ww:/etc/samba$ su Password:

step 2 先把 smb.conf备份一下,以防操作不当,还可以把该文件恢复回来 root@ww:/etc/samba# cp smb.conf smb.conf.bak

step 3 用vim打开smb.conf,把193行到200行修改成如下图所示:

4、添加samba添加一个root用户

root@ww:/etc/samba# smbpasswd -a root New SMB password:

Retype new SMB password:

输入密码,我这里输入的是root用户,也可以输入其他的存在用户名。

5、重启sam服务

root@ww:/etc/samba# service smbd restart

6.安装所需组件

sudo apt-get install samba

sudo apt-get install cifs-utils sudo apt-get install samba-common

7.创建共享文件

mkdir /home/xxx/share sudo chmod 777 share/

8.备份以及修改配置文件

sudo vi /etc/samba/smb.conf 在文件的末尾添加下面的语句: [share]

path = /home/xxx/share available = yes browseable = yes public = yes writable = yes

其中[share]表示共享的名称(不需要和共享的文件名一致),path表示共享文件的路径,public表示文件对所有人可见

9.重启Samba服务器

sudo /etc/init.d/samba restart

10.在Windows上访问Linux

方法1:Win + R 调出运行窗口,直接输入Linux的ip地址 ,例如 //192.168.137.3

方法2:在地址栏中直接输入Linux的ip地址,例如 //192.168.137.3

11.在Linux上访问Linux

在搜索栏或者ctrl+L调出地址栏,输入对方的IP,例如 smb://xx.xx.xx.xx

注意事项:

有时候在安装Samba以及相关组件的时候会出现: #apt-get install Reading package lists... Done Building dependency tree... Done

Package aptitude is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package has no installation candidate 出现这个问题的原因是软件包没有更新,这个问题在系统刚刚装的时候最为常见,解决方法如下所示: # apt-get update # apt-get upgrade

# apt-get install

//其中的packagename就是你所要安装软件

Ubuntu15.04安装samba服务:http://www.linuxdiyf.com/linux/12925.html fedora 22 samba使用:http://www.linuxdiyf.com/linux/14185.html 如何在Fedora或CentOS上使用Samba共享文件夹:http://www.linuxdiyf.com/linux/12396.html 低版本的linux系统装samba服务器:

http://www.linuxdiyf.com/linux/13464.html

Windows和RedHat Linux之间实现资源共享-Samba服务器:http://www.linuxdiyf.com/linux/10604.html

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4