Linux设置共享方法

来源:互联网 发布:查看别人淘宝店铺数据 编辑:程序博客网 时间:2024/04/27 20:23

 

1.       首先安装samba服务 cd /etc/samba 看是否存在此目录,如果没有请先安装。

2.       cp smb.conf /etc/samba/smb.conf.bak  先备份一下smb.conf文件.

3.       gedit smb.conf 对此文件进行编辑.

4.       首先找到

[global]
# workgroup = NT-Domain-Name or Workgroup-Name
        workgroup = workgroup

# server string is the equivalent of the NT Description field
        server string = Samba Server

上面这些不用理它,在global里找到下面这句:

security = share  设置share表示不需密码即可访问。

5.       然后找到[share]这一段,改为如下:

      [share]
        comment = Temporary file space         #
对共享文件夹的说明
        path = /tmp            #
表示想要共享的路径
        writeable = yes       #
表示可写入

              browseable = yes   #表示可浏览

              guest ok = yes              #所有用户均可访问

 

 

好了,保存文件推出之后,重起samba服务,然后就可以在Windows下访问Linux的共享了。当然如果为了安全你想要某一个具体的用户能够访问你的共享,你也可以把

security = share share改为 user。保存后退出。

[root@localhost samba]# smbpasswd -a username

New samba password: 输入密码就可以了,之后就需要密码的登陆了。

 

原创粉丝点击