Menu:
  :. HomePage
  :. Linux
  :. Solaris
  :. Windows
  :. Programování
  :. Java + Tomcat
  :. HW obecně
  :. VoIP - Asterisk
  :. Cisco - Mikrotik - Síť
  :. O mě
  :. Fotogalerie

 Testovací:
  :. ASP projekt
  :. JSP projekt



 Doporučuji:

Savvy - profesionální webhosting, webdesign a serverhosting
Internetový obchod Stromeček.cz - hardware, software a mobily za super ceny
AirCon Miroslav
Galerie fotek
Notebooky
Webdesign Praha

www.eprdel.cz
www.root.cz
Lumimont

NAVRCHOLU.cz
A



Vaše IP:
3.85.9.208

NFSv4 a ACL

Nastavovani ACL prav:

Pro práci s ACL nám slouží příkayz getfacl a setfacl. Jak již název napovídá, setfacl slouží k nastavování práv. Pro nastavení práv můžeme použít syntaxe:

setfacl -m práva soubor(y)

Práva se skládají z znaků r,w a x. Jejich význam je nasnadě (r - čtení, w - zápis, x - provádění)

Uvedeme si konkrétní příkad nastavení práv:

setfacl -m user:pavel:rwx Projects



Pro výpis práv můžeme použít utilitu getfacl. Práva jsou vypisována ve stejné formě, jako jsou zadávána. Pro výpis standardních práv u adresáře můžeme použít volbu -d.


NFS verze 4 (Fodora CORE 6)


Pro odzkouseni NFS  jsme zvolili server tak client na stejne siti a priradili jsme jim tyto IP:

  • Server:   hostname = "fc2", IP = 192.168.1.2/24

  • Client:   hostname = "nfsc" IP = 192.168.1.212/24


Zde je seznam vsech konfiguracnich souboru:

  • /etc/fstab - used on the NFS client

  • /etc/exports - used on the NFS server

  • /etc/auto.master - used on the NFS client

  • /etc/idmapd.conf - used on the NFS client and server

  • /etc/gssapi_mech.conf - used on the NFS client and server

  • /etc/init.d/portmap - used on the client and server

  • /etc/init.d/nfs - required on the server

  • /etc/init.d/rpcidmapd - required on both client and server

  • /etc/init.d/rpcsvcgssd - required on the server when RPCSEC_GSS is used

  • /etc/init.d/rpcgssd - required on the client when RPCSEC_GSS is used



Nastaveni Serveru:


Krok č. 1 - Přidat název klienata a IP do  /etc/hosts:

192.168.1.212 nfsc


Krok č.2 - Povolit port na firewalu

Ve Fedoře pomoci prikazu system-config-securitylevel povolit NFS případně povolit v iptables port 2049.

Krok č.3 - Nakonfigurovat  TCP Wrappers, abz bzl povolená Portmap

Z puvodni konfigurace /etc/hosts.allow

#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#

portmap : 127. : ALLOW
portmap : ALL : DENY


změnit a povolit portmap pro klient

portmap : 127. 192.168.1. : ALLOW
portmap : ALL : DENY


Krok č.4 - Ověřte existenci souboru /etc/gssapi_mech.conf. Toto je jeho defaultní instalace.

# GSSAPI Mechanism Definitions
#
# This configuration file determines which GSS-API mechanisms
# the gssd code should use
#
# NOTE:
# The initiaiization function "mechglue_internal_krb5_init"
# is used for the MIT krb5 gssapi mechanism. This special
# function name indicates that an internal function should
# be used to determine the entry points for the MIT gssapi
# mechanism funtions.
#
# library initialization function
# ================================ ==========================
# The MIT K5 gssapi library, use special function for initialization.
/usr/lib/libgssapi_krb5.so mechglue_internal_krb5_init
#
# The SPKM3 gssapi library function. Use the function spkm3_gss_initialize.
# /usr/local/gss_mechs/spkm/spkm3/libgssapi_spkm3.so spkm3_gss_initialize


Krok č.5 - Nakonfigurujte /etc/idmapd.conf

[General]

Verbosity = 0
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = test.cz

[Mapping]

Nobody-User = nfsnobody
Nobody-Group = nfsnobody





Krok č.6 - Nakonfigurujeme testovaci adresář pro export


Je dobré, aby na adresařich které chceme předavat dale pro sdilení, byla zapnutá podpora ACL viz konfigurace z /etc/fstab


LABEL=/home /home ext3 rw,acl 1 2



Dále je potřeba upravit soubor /etc/exports

### /etc/exports - a list of directories for NFS to export ###
## read/write export to the 192.168.1.0/24 network ##
/home 192.168.1.0/24(rw,fsid=0,insecure,no_subtree_check,sync,anonuid=65534,anongid=65534)


Krok č.7 - Konfigurace startovacích skriptů

[root@fc2 /]# chkconfig --level 0123456 portmap off
[root@fc2 /]# chkconfig --level 345 portmap on
[root@fc2 /]# chkconfig --level 0123456 rpcidmapd off
[root@fc2 /]# chkconfig --level 345 rpcidmapd on
[root@fc2 /]# chkconfig --level 0123456 nfslock off
[root@fc2 /]# chkconfig --level 345 nfslock on
[root@fc2 /]# chkconfig --level 0123456 nfs off
[root@fc2 /]# chkconfig --level 345 nfs on

[root@fc2 /]# chkconfig --level 0123456 rpcgssd off
[root@fc2 /]# chkconfig --level 0123456 rpcsvcgssd off


[root@fc2 /]# /etc/init.d/rpcgssd stop
[root@fc2 /]# /etc/init.d/rpcsvcgssd stop
[root@fc2 /]# /etc/init.d/portmap restart
Stopping portmapper: [ OK ]
Starting portmapper: [ OK ]
[root@fc2 /]# /etc/init.d/rpcidmapd restart
Shutting down NFS4 idmapd: [FAILED]
Starting NFS4 idmapd: [ OK ]
[root@fc2 /]# /etc/init.d/nfslock restart
Stopping NFS statd: [FAILED]
Starting NFS statd: [ OK ]
[root@fc2 /]# /etc/init.d/nfs restart
Shutting down NFS mountd: [FAILED]
Shutting down NFS daemon: [FAILED]
Shutting down NFS quotas: [FAILED]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]


Nastaveni klienta:



Odkazy:
http://www.vanemery.com/Linux/NFSv4/NFSv4-no-rpcsec.html
http://www.linuxzone.eu/index.phtml?ids=29&idc=839
http://www.vanemery.com/Linux/ACL/linux-acl.html
 
« Zpět na seznam