Ubuntu14.04安装samba与windows数据共享

2018-02-03 by 程序诗人


《Ubuntu14.04安装samba与windows文件共享》
环境:

windows10
ubuntu14.04


1、第一步,更新源
备份源列表,命令行:sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo gedit /etc/apt/sources.list
复制以下内容内容替换掉sources.list中的内容
最后执行命令 sudo apt-get update
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、第二步,关闭防火墙
执行命令:ufw disable 关闭防火墙
sudo vi /etc/profile,在最后一行加入ufwdisable,这样做的目是在每次开机的时候就关闭防火墙。
3、第二步,安装samba
安装:
sudo apt-get install samba samba-common
编辑配置文件:
sudo gedit /etc/samba/smb.conf
然后在末尾加入如下内容,如图:
[share]
path = /
browseable = yes
public = yes
writable = yes
available = yes

给samba添加用户
sudo smbpasswd -a 用户名,例如我将我的用户和root用户添加了,就是:sudo smbpasswd -a root


重新启动samb
sudo service smbd restart


4、第四步,检查win和ubuntu打的连通性

保证windows10和ubuntu14.04在同一网段下,是否互相能够ping通。


5、第五步,连接





祝你成功!!

第七城市

栏目导航(关闭)