阅读量:1
Here are the most common solutions for mounting remote storage on Debian:
-
NFS (Network File System)
- Install NFS Client: Run
sudo apt update && sudo apt install nfs-commonto install the required tools. - Create Mount Point: Use
sudo mkdir -p /mnt/nfsto create a directory for mounting. - Mount Remote Share: Execute
sudo mount -t nfs(replace with your server’s IP and share path).:/remote/share /mnt/nfs - Auto-Mount at Boot: Add
/mnt/nfs nfs defaults 0 0to/etc/fstabfor persistent mounting.
- Install NFS Client: Run
-
Samba (SMB/CIFS)
- Install Samba Client: Install
cifs-utilswithsudo apt update && sudo apt install cifs-utils. - Create Mount Point: Run
sudo mkdir -p /mnt/samba. - Mount Remote Share: Use
sudo mount -t cifs //(add/share /mnt/samba -o username= ,password= iocharset=utf8for non-ASCII characters). - Auto-Mount at Boot: Add
//to/share /mnt/samba cifs username= ,password= ,iocharset=utf8 0 0 /etc/fstab.
- Install Samba Client: Install
-
SSHFS (Secure Shell Filesystem)
- Install SSHFS: Run
sudo apt update && sudo apt install sshfs. - Create Mount Point: Use
sudo mkdir -p /mnt/sshfs. - Mount Remote Share: Execute
sudo sshfs(use@ :/remote/dir /mnt/sshfs -o identityfile=~/.ssh/id_rsafor key-based auth). - Auto-Mount at Boot: Add
to@ :/remote/dir /mnt/sshfs fuse.sshfs _netdev,user,idmap=user,identityfile=~/.ssh/id_rsa,allow_other,default_permissions 0 0 /etc/fstab.
- Install SSHFS: Run
-
FTP (via curlftpfs)
- Install curlftpfs: Run
sudo apt update && sudo apt install curlftpfs. - Create Mount Point: Use
mkdir ~/ftp_mount. - Mount FTP Server: Execute
curlftpfs ftp://(store credentials in: @ ~/ftp_mount ~/.netrcfor automation). - Auto-Mount at Boot: Add
to~/ftp_mount fuse._curlftpfs _netdev,user,allow_other,default_permissions 0 0 /etc/fstab.
- Install curlftpfs: Run
Key Notes:
- Replace placeholders (e.g.,
,,) with your actual server details. - For security, avoid hardcoding passwords in
/etc/fstab; use credential files (e.g.,~/.netrc) withchmod 600permissions. - Ensure remote servers allow incoming connections on the respective ports (NFS: 2049, Samba: 137-139/445, SSH: 22, FTP: 21).
- Test mounts with
sudo mount -abefore rebooting to verify/etc/fstabsyntax.
以上就是关于“Debian挂载远程存储解决方案”的相关介绍,筋斗云是国内较早的云主机应用的服务商,拥有10余年行业经验,提供丰富的云服务器、租用服务器等相关产品服务。云服务器资源弹性伸缩,主机vCPU、内存性能强悍、超高I/O速度、故障秒级恢复;电子化备案,提交快速,专业团队7×24小时服务支持!
简单好用、高性价比云服务器租用链接:https://www.jindouyun.cn/product/cvm