Debian文件系统共享主要有以下两种方式:
sudo apt update && sudo apt install samba
/etc/samba/smb.conf,添加共享配置(如[shared]段,指定路径、权限等)。[shared]
path = /path/to/share
read only = no
browsable = yes
valid users = username
sudo smbpasswd -a username
sudo systemctl restart smbd nmbd
sudo ufw allow samba
\\Debian_IP\共享名,输入用户名密码。smbclient或挂载命令访问。sudo apt update && sudo apt install nfs-kernel-server
/etc/exports,添加共享路径及权限(如/path 192.168.1.0/24(rw,sync))。sudo exportfs -a
sudo systemctl restart nfs-kernel-server
nfs-common后,使用mount命令挂载远程目录。sudo mount -t nfs Debian_IP:/path /mnt/local_mount
rw读写、ro只读)。