📁 Sử Dụng SSHFS
📋 Giới Thiệu
SSHFS (SSH Filesystem) cho phép bạn mount filesystem từ server từ xa vào máy local thông qua kết nối SSH. Điều này giúp:
- Truy cập file từ xa như file local
- Sử dụng các công cụ local để thao tác file từ xa
- Không cần cấu hình phức tạp như NFS
📦 Cài Đặt
# Cài đặt SSHFS
sudo apt -y install sshfs
🛠️ Cách Sử Dụng Cơ Bản
1. Tạo Mount Point
# Tạo thư mục để mount
mkdir ~/remote-files
2. Mount Filesystem
# Cú pháp cơ bản
sshfs user@remote-server:/remote/path ~/remote-files
# Ví dụ cụ thể
sshfs [email protected]:/home/admin/data ~/remote-files
3. Kiểm Tra Mount Point
# Kiểm tra mount point
df -hT
# Output mẫu
Filesystem Type Size Used Avail Use% Mounted on
[email protected]:/home/admin/data fuse.sshfs 100G 50G 50G 50% /home/user/remote-files
4. Unmount Filesystem
# Ngắt kết nối SSHFS
fusermount -u ~/remote-files