Debian文件系统可通过以下协议支持远程访问,需根据场景选择合适方式:
SSHFS(基于SSH)
sudo apt install sshfs
sshfs user@remote_host:/remote/path /local/mountpoint
fusermount -u /local/mountpoint
NFS(网络文件系统)
nfs-kernel-server
,编辑/etc/exports
添加共享目录(如/data 192.168.1.0/24(rw,sync)
),重启服务sudo systemctl restart nfs-kernel-server
。nfs-common
,挂载命令sudo mount -t nfs remote_host:/shared/path /local/mountpoint
,可设置开机自动挂载。Samba(SMB/CIFS)
samba
,编辑/etc/samba/smb.conf
添加共享(如[share] path=/path/to/share writable=yes valid users=username
),设置用户密码smbpasswd -a username
,重启服务sudo systemctl restart smbd
。cifs-utils
,挂载命令sudo mount -t cifs //remote_host/share /local/mountpoint -o username=username,password=xxx
。FTP/SFTP
vsftpd
(FTP)或openssh-server
(SFTP,默认已安装)。ftp
或sftp
命令连接,通过ls
查看目录,get/put
传输文件。注意事项:
ro
或可编辑rw
),避免敏感数据泄露。