Configuring an Apple iOS-Compatible SMB Share on Ubuntu: A Comprehensive Guide
Apple iOS-compatible SMB share, Ubuntu, file sharing, configure, step-by-step guide, SMB/CIFS, Raspberry Pi, Raspbian
In today's interconnected world, seamless file sharing and collaboration across different platforms are essential. If you're an Ubuntu user looking to configure an Apple iOS-compatible SMB (Server Message Block) share, this guide will walk you through the process step-by-step. By following these instructions, you can effortlessly establish a shared environment between your Ubuntu machine and iOS devices for convenient file transfers and access. So let's dive in and configure an Apple iOS-compatible SMB share on Ubuntu!
If you want to use a USB drive as your SMB mount, please follow the Auto-Mounting a USB Drive as ext4 in fstab on Ubuntu: A Comprehensive Guide.
The following should also work fine on the Raspberry Pi Raspbian.
Step 1: Install Samba To begin, we need to install the Samba package, which provides SMB/CIFS services on Ubuntu. Open a terminal and enter the following command to install Samba:
sudo apt update
sudo apt install samba
Step 2: Configure the SMB Share Once Samba is installed, the next step is to configure the SMB share. Open the Samba configuration file by entering the following command in the terminal:
sudo nano /etc/samba/smb.conf
Within the file, locate the [global] section and add the following lines:
[global]
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
#log level = 3
panic action = /usr/share/samba/panic-action %d
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = yes
mangled names = no
dos charset = cp866
unix charset = UTF8
vfs objects = fruit streams_xattr
fruit:metadata = stream
fruit:model = MacSamba
fruit:posix_rename = yes
fruit:veto_appledouble = no
fruit:nfs_aces = no
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes
server min protocol = SMB2
client min protocol = SMB3
......
Then, at the end of the file, create a new [share] section with the following:
......
[share]
Comment = Pi shared folder
Path = /home/samba
read only = no
guest ok = yes
browsable = yes
create mask = 0777
directory mask = 0777
public = yes
force create mode = 0660
force directory mode = 2770
This is on a home network, so we allow anonymous "guest" access, but you would obviously want to do this differently on a more secure network.
Step 3: Create a Shared Directory Now, let's create a directory that will be shared with iOS devices. Choose an appropriate location and name for the directory, and create it using the following command:
sudo mkdir /path/to/shared_directory
Replace "/path/to/shared_directory" with the desired path of your shared directory.
Step 4: Set Permissions and Ownership To ensure proper access, we need to set appropriate permissions and ownership for the shared directory. Use the following commands to set the necessary permissions:
sudo chmod -R 0777 /path/to/shared_directory
sudo chown -R nobody:nogroup /path/to/shared_directory
Step 5: Restart Samba Service To apply the changes made to the Samba configuration file, restart the Samba service by running the following command:
sudo service smbd restart
Step 6: Connect to the SMB Share from iOS With the SMB share configured on Ubuntu, you can now connect to it from your iOS device. Follow these steps:
- Open the Files app on your iOS device.
- Tap the "..." (three dots) button in the top-right corner.
- Select "Connect to Server."
- Enter the SMB