{"id":422,"date":"2012-12-19T12:28:07","date_gmt":"2012-12-19T05:28:07","guid":{"rendered":"http:\/\/blog.trichev.com\/?p=422"},"modified":"2017-08-10T09:32:51","modified_gmt":"2017-08-10T02:32:51","slug":"nfs-server-on-debian-6-0-squeeze","status":"publish","type":"post","link":"https:\/\/trichev.com\/blog\/2012\/12\/19\/nfs-server-on-debian-6-0-squeeze\/","title":{"rendered":"NFS Server on Debian 6.0 squeeze"},"content":{"rendered":"<p>apt-get install nfs-common portmap nfs-kernel-server<\/p>\n<p>vi \/etc\/exports:<\/p>\n<p>\/home 192.168.0.0\/24(rw,sync,no_root_squash,no_subtree_check)<\/p>\n<p># *note \/home \u21d2 shared directory<br \/>\n#10.0.0.0\/24 \u21d2 range of networks NFS permits accesses<br \/>\n#rw \u21d2 possible to read and write<br \/>\n#sync \u21d2 synchronize<br \/>\n#no_root_squash \u21d2 enable root privilege<br \/>\n#no_subtree_check \u21d2 disable subtree check<\/p>\n<p>IPTABLES:<br \/>\n-A INPUT -s 192.168.0.0\/24 -d 192.168.0.1 -m state &#8211;state NEW -p udp &#8211;dport 111 -j ACCEPT<br \/>\n-A INPUT -s 192.168.0.0\/24 -d 192.168.0.1 -m state &#8211;state NEW -p tcp &#8211;dport 111 -j ACCEPT<br \/>\n-A INPUT -s 192.168.0.0\/24 -d 192.168.0.1 -m state &#8211;state NEW -p udp &#8211;dport 2049 -j ACCEPT<br \/>\n-A INPUT -s 192.168.0.0\/24 -d 192.168.0.1 -m state &#8211;state NEW -p tcp &#8211;dport 2049 -j ACCEPT<br \/>\n-A INPUT -s 192.168.0.0\/24 -d 192.168.0.1 -m state &#8211;state NEW -p udp &#8211;dport 32764:32769 -j ACCEPT<br \/>\n-A INPUT -s 192.168.0.0\/24 -d 192.168.0.1 -m state &#8211;state NEW -p tcp &#8211;dport 32764:32769 -j ACCEPT<\/p>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0435\u043a\u0443\u0440\u043d\u043e\u0441\u0442\u044c<br \/>\n\/etc\/hosts.deny:<br \/>\nlockd:ALL<br \/>\nmountd:ALL<br \/>\nrquotad:ALL<br \/>\nstatd:ALL<\/p>\n<p>\/etc\/hosts.allow:<br \/>\nlockd: 192.168.0.1 , 192.168.0.2<br \/>\nrquotad: 192.168.0.1 , 192.168.0.2<br \/>\nmountd: 192.168.0.1 , 192.168.0.2<br \/>\nstatd: 192.168.0.1 , 192.168.0.2<\/p>\n<p>\/etc\/init.d\/portmap start<br \/>\n\/etc\/init.d\/nfs-kernel-server start<br \/>\n\/etc\/init.d\/nfs-common start<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c (showmount -e 192.168.0.1). \u0414\u0430, \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0410 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442.\u043a. \u043f\u043e\u0440\u0442\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u0448\u0438\u0435 \u0438 \u0445\u0430\u043e\u0442\u0438\u0447\u043d\u043e. \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u043e rpcinfo -p. \u041d\u0443\u0436\u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u044d\u0442\u043e \u0445\u043e\u0437\u044f\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0432\u0438\u0434\u0443 &#8211;dport 32764:32769.<br \/>\n\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c Debian SecuringNFS WIKI:<\/p>\n<p># \/etc\/default\/nfs-common<br \/>\nSTATDOPTS=&#8221;&#8211;port 32765 &#8211;outgoing-port 32766&#8243;<\/p>\n<p># \/etc\/default\/nfs-kernel-server<br \/>\nRPCMOUNTDOPTS=&#8221;-p 32767&#8243;<\/p>\n<p># \/etc\/default\/quota<br \/>\nRPCRQUOTADOPTS=&#8221;-p 32769&#8243;<\/p>\n<p># \/etc\/modprobe.d\/local.conf<br \/>\noptions lockd nlm_udpport=32768 nlm_tcpport=32768<br \/>\noptions nfs callback_tcpport=32764<\/p>\n<p>\u0412\u0441\u0435 \u043e\u043f\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0430\u0435\u043c. \u0414\u043b\u044f \u0443\u0441\u043f\u043e\u043a\u043e\u0435\u043d\u0438\u044f \u0434\u0443\u0448\u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u0440\u0442\u044b \u043e\u0442\u043a\u0440\u044b\u043b\u0438\u0441\u044c \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 iptables&#8217;\u0430\u0445 (rpcinfo -p).<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0438:<br \/>\n<a href=\"http:\/\/en.wikipedia.org\/wiki\/Network_File_System_%28protocol%29\">wikipedia.org (NFS)<\/a><br \/>\n<a href=\"http:\/\/wiki.debian.org\/SecuringNFS\">http:\/\/wiki.debian.org\/SecuringNFS<\/a><br \/>\n<a href=\"http:\/\/www.tldp.org\/HOWTO\/NFS-HOWTO\/\">http:\/\/www.tldp.org\/HOWTO\/NFS-HOWTO\/<\/a><br \/>\n<a href=\"http:\/\/www.tldp.org\/HOWTO\/NFS-HOWTO\/security.html\">http:\/\/www.tldp.org\/HOWTO\/NFS-HOWTO\/security.html<\/a><br \/>\n<a href=\"http:\/\/www.tldp.org\/HOWTO\/NFS-HOWTO\/server.html\">http:\/\/www.tldp.org\/HOWTO\/NFS-HOWTO\/server.html<\/a><br \/>\n<a href=\"http:\/\/24may.kharkov.ua\/page65.html\">http:\/\/24may.kharkov.ua\/page65.html<\/a><br \/>\n<a href=\"http:\/\/www.crazysquirrel.com\/computing\/debian\/servers\/nfs.jspx\">http:\/\/www.crazysquirrel.com\/computing\/debian\/servers\/nfs.jspx<\/a><br \/>\n<a href=\"http:\/\/mohado.narod.ru\/ru\/nfs.html\">http:\/\/mohado.narod.ru\/ru\/nfs.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>apt-get install nfs-common portmap nfs-kernel-server vi \/etc\/exports: \/home 192.168.0.0\/24(rw,sync,no_root_squash,no_subtree_check) # *note \/home \u21d2 shared directory #10.0.0.0\/24 \u21d2 range of networks NFS permits accesses #rw \u21d2 possible to read and write #sync \u21d2 synchronize #no_root_squash \u21d2 enable root privilege #no_subtree_check \u21d2 disable subtree check IPTABLES: -A INPUT -s 192.168.0.0\/24 -d 192.168.0.1 -m state &#8211;state NEW -p [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[231],"tags":[29,177,32,176,28,14,11],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/422"}],"collection":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/comments?post=422"}],"version-history":[{"count":7,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/422\/revisions"}],"predecessor-version":[{"id":521,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/422\/revisions\/521"}],"wp:attachment":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/media?parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/categories?post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/tags?post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}