IT/리눅스

리눅스 서버 원격 마운트

휴식과생각 2022. 8. 31. 17:44

::CentOS 7기준

 

1. 조건
상대방 컴퓨터에 ssh 설치되어 있을 것
#rpm -qa|grep ssh

2. 내컴퓨터 설치 확인
#rpm -qa|grep sshfs

3. 설치
#yum install epel-release -y  (저장소 설치)
#yum install fuse sshfs -y

4. 사용
sshfs [원격 디렉토리] [마운트 포인트] -o allow_other
#sshfs 사용자@192.168.0.10:/home/user /mount_usr -o allow_other

5. 쉘스크립트
#vi
----
#! /bin/bash
sshfs 사용자@192.168.0.10:/home/user /mount_usr -o allow_other

6. 마운트 해제
#fuser -u [디렉토리]