2011年10月15日 星期六

Linux 70% Lab – Samba Server with IPv6

Server2:
  • mv /etc/samba/smb.conf /etc/samba/smb.conf.origin
  • mkdir /srv/samba
  • vi /etc/samba/smb.conf
新增下列內容:
 [global]
        workgroup = LXLAB
        netbios name = server01
        server string = samba server on server01
        interfaces = lo eth0
        log file = /var/samba/log.%m
        max log size = 100
        security = user
        passdb backend = tdbsam
        hosts allow = fd53:1a82:4e39:0::/64 ::1
        printing = cups
        printcap name = cups
        cups options = raw

[labdir]
        comment = user level, for amy and boby (rw)
        path = /srv/samba/labdir
        read only = No
        printable = No
        public = No
        browseable = Yes
        inherit acls = Yes
        valid user = amy boby

  • chkconfig smb on
  • chkconfig nmb on
  • useradd –m amy
  • useradd –m boby
  • smbpasswd –a amy
  • smbpasswd –a boby
  • pdbedit –L –v | grep amy
  • pdbedit –L –v | grep boby
  • service smb start
  • service nmb start
  • testparm

HostOS:
  • smbclient –L server2
  • smbclient –U amy //server2/labdir

磁碟配額部份:

Server2:
  • 先關機多加一顆虛擬硬碟
  • fdisk /dev/sdb
          n --> p --> 1 --> default --> default --> p --> w
  • mkfs.ext3 /dev/sdb1
  • vi /etc/fstab
做下列修改:
/dev/sdb1 /           /srv/samba         ext3       defaults,usrquota        0 0
  • mount -a
  • mount   確定剛才的設定是否套用
  • cd /srv/samba
  • quotacheck –uvcm /dev/sdb1
  • ll   應有aquota.user
  • chkconfig boot.quota on
  • quotaon -uv /dev/sdb1
  • edquota –u amy
  • edquota –u boby
amy和boby都做以下設定
Filesystem                   blocks       soft       hard         inodes     soft     hard                     /dev/sdb1                          0       8000      10000         14           0        0
  • quota –u amy
  • quota –u boby  查看是否設定正確
  • mkdir labdir
  • chmod 1777 labdir
HostOS:
  • smbclient -U amy //server2/labdir
  • put files 測試

沒有留言:

張貼留言