주 메뉴 열기

wwiki β

바뀜

NFS

1,283 바이트 추가됨, 2022년 4월 10일 (일) 08:55
mount하기
Network File System
==설치==RFC에 정의된 오픈 표준이다.
=[[인터넷 프로토콜 스위트]]에서 응용 계층에 속한다.  == NFS client == === 설치 ===
$ apt-get install nfs-common
/etc/[[Fstab]]파일을 편집하여 자동마운트 시킬 수 있다.
=== 공유폴더 확인 ===다음 명령으로 nfs서버의 공유폴더를 확인할 수 있다. $ showmount --exports [nfs 서버 아이피] ==== 위치 ====/sbin/showmount ==== 사용법 ====Usage: /sbin/showmount [-adehv] [--all] [--directories] [--exports] [--no-headers] [--help] [--version] [host] === 마운트 ===[[mount]]명령으로 마운트할 수 있다. uid와 gid에 대한 옵션은 서버와 클라이언트 버전이 낮은 경우 적용이 되지 않는다. 서버의 옵션으로 설정할 수 있다. $ mount --types nfs --options uid=1000,gid=1000,rw 192.168.0.256:/export /export/etc/[[fstab]]파일을 편집하여 자동마운트 시킬 수 있다. == NFS server ===
$ sudo apt install nfs-kernel-server
====설정====
/etc/exports
https://linux.die.net/man/5/exports ==== General Options ==== ===== no_subtree_check: =====파일 시스템의 전체 디렉토리가 아닌 하부 디렉토리가 내보내진 경우,서버는 내보낸 하부 디렉토리에 요청된 파일이 존재하는지를 검사한다. 이러한 검사 과정을 하부구조 검사라고 부른다. 이 옵션을 선택하시면 하부구조 검사를 사용하지 않는다. 전체 파일 시스템이 내보내진 경우에 이 옵션을 선택하면 하부구조 검사를 하지 않음으로서 전송률을 높일 수 있다. ==== User ID Mapping ==== ===== root_squash =====uid/gid 0을 익명 uid/gid로 매핑된다.
no_root_squash : client가 root면 server에도 직역하면 root를 찌그러트리다. root로 접근하게 함파일을 생성할 수 없다. 신뢰할 수 있는 사람에게만 허용할 것
==== 서비스 = no_root_squash ===== $ systemctl status nfs-serverroot squashing을 끈다.service
== [[mount]] ==client가 root면 server에도 root로 접근하게 함. 신뢰할 수 있는 사람에게만 허용하는 것이 좋다.
=== /sbin/showmount == all_squash =====Usage: /sbin/showmount [-adehv]모든 uid와 gid를 익명유저 매핑한다.
[--all] [--directories] [--exports]===== anonuid and anongid =====익명 계정의 uid,gid를 명시적으로 설정한다. all_squash,anonuid=xxx,anongid=yyy
[=== 서비스 === $ systemctl status nfs-server.service"A dependency job for nfs-noserver.service failed."에러가 날 때는 재부팅하거나 서비스파일(/lib/systemd/system/nfs-headers] [--help] [--version] [host]server.service)에서 의존성 항목을 체크한다.
[[분류:파일]]
[[분류:네트워크]]
[[분류:프로토콜]]
편집
2,431