-
Notifications
You must be signed in to change notification settings - Fork 0
Install Samba directly on Ubuntu
To install Samba on Ubuntu and configure it so that you can mount it in Finder on a Mac, follow these steps:
-
Update the Package List:
sudo apt update
-
Install Samba:
sudo apt install samba
-
Edit the Samba Configuration File:
Open the Samba configuration file in your preferred text editor. For example, using
nano
:sudo nano /etc/samba/smb.conf
-
Add a New Share:
Scroll down to the bottom of the file and add your share definition. For example:
[shared] path = /path/to/your/shared/folder available = yes valid users = your_username read only = no browsable = yes public = yes writable = yes
Replace
/path/to/your/shared/folder
with the actual path to the folder you want to share, andyour_username
with your actual username. -
Save and Exit:
- If using
nano
, save the file by pressingCTRL + O
, thenEnter
, and exit withCTRL + X
.
- If using
-
Add a User to Samba:
sudo smbpasswd -a your_username
Follow the prompts to set the Samba password.
-
Restart the Samba Services:
sudo systemctl restart smbd sudo systemctl restart nmbd
-
Open Finder and press
Command + K
or go toGo > Connect to Server
. -
Enter the Samba Share Address:
Enter the address in the format
smb://[server_ip]/[shared]
. For example:smb://192.168.1.100/shared
Replace
192.168.1.100
with the IP address of your Ubuntu server andshared
with the name of the share you defined in the Samba configuration file. -
Connect and Authenticate:
Click
Connect
, then enter your Samba username and password when prompted.
Your Samba share should now be accessible in Finder on your Mac.
-
Firewall Configuration: Ensure that your firewall allows Samba traffic. You can enable Samba-related services with:
sudo ufw allow samba
-
Permissions: Make sure the directory you are sharing has the appropriate permissions for the Samba user to access.
For further details, you can refer to the official Ubuntu Samba documentation and Samba Wiki.