红联Linux门户
Linux帮助

Ubuntu15.04安装samba

发布时间:2015-10-10 09:52:49来源:linux网站作者:eskimoer

1.安装所需组件
sudo apt-get install samba 
sudo apt-get install cifs-utils 
sudo apt-get install samba-common


2.创建共享文件
mkdir /home/xxx/share 
sudo chmod 777 share/


3.备份以及修改配置文件
sudo cp /etc/samba/smb.conf  /etc/samba/smb.conf.bak 
sudo gedit /etc/samba/smb.conf 

在文件的末尾添加下面的语句:
[share] 
path = /home/xxx/share 
available = yes 
browseable = yes 
public = yes 
writable = yes

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


4.重启Samba服务器
sudo /etc/init.d/samba restart


5.在Windows上访问Linux
方法1:Win + R 调出运行窗口,直接输入Linux的ip地址 ,例如 //192.168.137.3
方法2:在地址栏中直接输入Linux的ip地址,例如 //192.168.137.3


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


注意事项:
有时候在安装Samba以及相关组件的时候会出现:
#  apt-get install <packagename>
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 <packagename> has no installation candidate

出现这个问题的原因是软件包没有更新,这个问题在系统刚刚装的时候最为常见,解决方法如下所示:
# apt-get update
# apt-get upgrade
# apt-get install <packagename>
//其中的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