Skip to content

Instantly share code, notes, and snippets.

@tanyuan
Last active February 25, 2022 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanyuan/793a3f61a1155a227a3fce07a3793304 to your computer and use it in GitHub Desktop.
Save tanyuan/793a3f61a1155a227a3fce07a3793304 to your computer and use it in GitHub Desktop.
Access Arch Linux folders from Mac using samba

Access Arch Linux folders from Mac using samba

Tested with Arch Linux and macOS Sierra

First make sure that the two machines can see each other.

On Arch, find out IP of Arch Linux machine by:

ip addr

On Mac, ping Arch Linux:

ping $IP

You should see several response time. If they are under the same network but still cannot see each other, check router settings to disable isolation/separate feature.

On Arch, install samba and edit samba config:

sudoedit /etc/samba/smb.conf

Lines that begin with semicolon (;) are comments.

Make sure you have the following lines:

[global]

   workgroup = WORKGROUP

   usershare path = /var/lib/samba/usershare
   usershare max shares = 100
   usershare allow guests = yes
   usershare owner only = yes
   
[homes]

   comment = Home Directories
   browseable = no
   writable = yes
   

Set samba username and password:

sudo sambapasswd -a $USERNAME

The system will prompt for setting passsword.

Start samba server:

systemctl start smbd

This command needs super user password.

You have finished settings on Arch.

On Mac, open Finder, menu Go > Network, and you will see the computer name. Click Connect as ... to enter samba username and password.

Wait for a while and you can see the home directory!

On Arch, to stop samba server:

systemctl stop smbd

To start samba server when booted:

systemctl enable smbd

To disable:

systemctl disable smbd
@UglyWillDuckling
Copy link

I think it is smbapasswd not sambapasswd

@ForceGT
Copy link

ForceGT commented Feb 25, 2022

Also it is smb.service not smbd.service

And smbpasswd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment