在Ubuntu上設置共享文件夾的方法主要有兩種:使用Samba共享和使用NFS共享。
使用Samba共享:
sudo apt update
sudo apt install samba
sudo mkdir /path/to/shared_folder
sudo chmod -R 777 /path/to/shared_folder
[shared_folder]
path = /path/to/shared_folder
writable = yes
guest ok = yes
sudo systemctl restart smbd
sudo systemctl restart nmbd
使用NFS共享:
sudo apt update
sudo apt install nfs-kernel-server
sudo mkdir /path/to/shared_folder
sudo chmod -R 777 /path/to/shared_folder
/path/to/shared_folder *(rw,sync,no_subtree_check)
sudo exportfs -a
sudo systemctl restart nfs-kernel-server
sudo mount ubuntu_ip:/path/to/shared_folder /mnt/shared_folder
以上是在Ubuntu上設置共享文件夾的兩種方法,根據實際需求選擇適合的方法進行設置。