2
头图

1. Create a shared folder

First create a shared folder in Ubuntu. For example: share folder

Right-click on the share folder and select Local Network Share from the pop-up menu.

After checking the configuration according to the screenshot, create a shared folder.

When the sharing icon appears in the lower right corner of the folder, it means that the sharing is successful.
At this point, the mac has been able to access the share folder normally, but it only has access permissions and no write permissions.
If you only need access permissions, you can directly view 3. Mac access to shared folders
If mac also needs to have write permission to the shared folder, samba needs to be configured.

2. Configure samba

sudo vim /etc/samba/smb.conf

Add the above configuration at the end of smb.conf and add the following configuration at the end of smb.conf, as shown in the figure.

[share]
   comment = share folder
   browseable = yes
   path = #更改为共享目录
   create mask = 0777
   directory mask = 0777
   force user = nobody
   force group = nogroup
   available = yes
   writeable = yes


Search for usershare and add the following configuration under usershare allow guests = yes. as the picture shows.

usershare owner only = false


After adding the above configuration, restart the samba service.

sudo /etc/init.d/smbd restart

So far, the samba configuration is complete.

3. Mac access to shared folders

Finder→Go→Connect To Server...


Enter smb://ip and click Connect. Where ip is the ip of ubuntu notebook.

Name Enter the Ubuntu login account.
Password Enter the Ubuntu login password and click Connect.

Click OK, then the connection is successful.


TroyLiu
111 声望2 粉丝

Java 开发工程师