IT/LINUX
Linux에서 NFS 서버를 설정하는 방법
ssung85
2023. 5. 3. 22:41
728x90
NFS Server
#firewalld disable
systemctl stop firewalld
systemctl disable firewalld
# nfs 설치
yum -y install nfs-utils
# 서비스 시작 / 부팅 시 자동 시작
systemctl start nfs-server
systemctl start rpcbind
systemctl enable nfs-server
systemctl enable rpcbind
# 공유할 디렉토리 생성
mkdir /nfstest
chmod 777 /nfstest
# mount 설정
# 읽고 쓰기(rw) 가능, 클라이언트의 계정을 root로 매핑(no_root_squash), 서버-클라이언트 동기화(rync)
/etc/exports
/nfstest 192.168.213.*(rw,sync,no_root_squash)
# 서비스 재시작
systemctl restart nfs-server
#확인
showmount -e
exportfs -v
NFS Client
# nfs 설치
yum -y install nfs-utils
# 서비스 시작 / 부팅 시 자동 시작
systemctl start nfs-server
systemctl enable nfs-server
systemctl start rpcbind
systemctl enable rpcbind
# 공유할 디렉토리 생성
mkdir /nfstest
chmod 777 /nfstest
#mount point 확인
showmount -e 192.168.213.212
# mount 임시 적용
# 서버의 /nfstest 디렉토리를 로컬 /nfstest에 마운트
mount -t nfs 192.168.213.212:/nfstest /nfstest
# mount 영구 적용
vi /etc/fstab
192.168.213.212:/nfstest /nfstest nfs defaults 0 0
- 참고 영상
728x90