Ubutu10.10 安装SAMBA

来源:互联网 发布:阿里云电话号码 编辑:程序博客网 时间:2024/06/05 11:57

1、首先安装samba软件包:

root@ubuntu:~#apt-get install samba

root@ubuntu:~#apt-get install samba4

(注:最初只安装samba,发现在进行samba服务启动或停止时,命令不识别,因此再安装samba4软件包。)

samba命令:

启动服务:root@ubuntu:~#/etc/init.d/samba4 start

停止服务:root@ubuntu:~#/etc/init.d/samba4 stop

restart:root@ubuntu:~#/etc/init.d/samba4 restart

2、创建共享文件夹

a)在home文件夹下创建share文件夹

b)编辑smb.conf:

root@ubuntun:~#gedit /etc/samba/smb.conf

将smb.conf中的security=user更改为security=share,并在最后增加:

[share]
comment=this is Linux share directory
path=/home/share
public=yes
writable=yes
保存smb.conf文件后退出

c)重启samba服务:

root@ubuntu:~#/etc/init.d/samba4 restart

3、xp访问共享文件夹

a)查看虚拟机的ip地址:

root@ubuntu:~#ifconfig

得到虚拟机中ubuntu的ip地址为192.168.102.129(此时用xp中的命令行,可以ping通ubuntu)

b)在xp中点击运行输入//192.168.102.129

看到share文件夹,点击进入,share文件夹即为共享文件夹,把工程放入share文件夹中,在xp下就可以访问

 

注意:share必须放到home文件夹下,否则会报错