ubuntu 10.04下搭建samba文件服务器

十一月 25th, 2010 Posted in Ubuntu | 阅读次数: 46
双线Linux服务器合租   Nginx服务器合租   Linux服务器合租64G超大内存

Author:gaojinbo
Time:2010-11-25

由于使用文件服务器的人少,权限分配也不太复杂,所以使用samba来替换win2008的文件服务器。10分钟搭建功能强大的samba文件服务器。samba+acl

权限分配:
目录:
1.ylmf
    1.项目文档
    2.个人文档
    3.公共文档

boss    所有权限
public    2,3文件夹读写,1文件夹只读

 

1.开启acl并重启
vi /etc/fstab
UUID=de8cdf27-39ee-40bd-8b70-dba057d3e351 /fileserver            ext4    acl        0       2

apt-get install acl
reboot

 

 

2.建立目录
mkdir -p /fileserver/1.ylmf/1.项目文档
mkdir -p /fileserver/1.ylmf/2.个人文档
mkdir -p /fileserver/1.ylmf/3.公共文档

 

 

3.添加用户并设置密码
useradd boss -s /usr/sbin/nologin
useradd public -s /usr/sbin/nologin
passwd boss
passwd public

 

 

4.设置acl文件访问权限
cd /fileserver/
setfacl -m u:public:rx 1.ylmf
cd 1.ylmf
setfacl -m u:public:rx  1.项目文档
setfacl -m u:public:rwx 2.个人文档
setfacl -m u:public:rwx 3.公共文档
chown -R boss:boss /fileserver/1.ylmf
chmod -R 0750 /fileserver/1.ylmf

 

 

5.配置samba
apt-get install samba

vi /etc/samba/smb.conf
#最后添加:
[ylmf]
        comment = YLMF File Server by gaojinbo
        path    = /fileserver
        public = no
        writeable = yes
        create mask = 0600
        directory mask = 0700
        guest ok = no

 

 

6.添加smba用户
smbpasswd -a boss
smbpasswd -a public
密码输入gaojinbo.com

 

 

7.重启samba
/etc/init.d/smbd  restart

 

 

8.访问测试

 

完成!

Linux主机   PHP主机   Nginx主机   双线Linux服务器

相关日志:

Tags:

3 Responses to “ubuntu 10.04下搭建samba文件服务器”

  1. How to Lose Love Handles Fast Says:

    Lose Love Handles Fast…

    [...]below you’ll see my recommended links page http://www.loselovehandlesfastblog.com/links/ with some excellent websites that I think you should go visit[...]…


  2. Louis G Quartararo MD NJ Says:

    Awesome website…

    [...]the time to read or visit the content or sites we have linked to below the[...]……


  3. Maxwell IN foundation repair Says:

    [...]we like to honor many other internet sites on the web, even if they aren’t linked to us, by linking to them. Under are some webpages worth checking out[...]……

    [...]Here are some of the sites we recommend for our visitors[...]……


留下您的脚印