This guide provides detailed instructions for mounting Samba shares on different operating systems.
- Open File Explorer
- Click on This PC in the left sidebar
- Click Map network drive in the toolbar
- Choose a drive letter (e.g., Z:)
- Enter the folder path:
\\<server-ip>\<share-name>- Example:
\\192.168.1.100\user1
- Example:
- Check "Connect using different credentials" if needed
- Click Finish
- Enter your username and password when prompted
# Map a network drive
net use Z: \\<server-ip>\<share-name> /persistent:yes
# With credentials
net use Z: \\<server-ip>\<share-name> /user:<username> <password> /persistent:yes
# Example
net use Z: \\192.168.1.100\user1 /user:user1 mypassword /persistent:yes# Map network drive
New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\<server-ip>\<share-name>" -Persist
# With credentials
$credential = Get-Credential
New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\<server-ip>\<share-name>" -Credential $credential -Persist
# Example
New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\192.168.1.100\user1" -Persist# Disconnect network drive
net use Z: /delete
# Disconnect all network drives
net use * /delete- Open Finder
- Press
Cmd + Kor go to Go → Connect to Server - Enter the server address:
smb://<server-ip>- Example:
smb://192.168.1.100
- Example:
- Click Connect
- Choose Registered User
- Enter your username and password
- Select the share you want to mount
- Click OK
# Create mount point
sudo mkdir -p /Volumes/<share-name>
# Mount the share
sudo mount -t smbfs //username:password@<server-ip>/<share-name> /Volumes/<share-name>
# Example
sudo mkdir -p /Volumes/user1
sudo mount -t smbfs //user1:mypassword@192.168.1.100/user1 /Volumes/user1# Mount without password in command (will prompt)
sudo mount -t smbfs //username@<server-ip>/<share-name> /Volumes/<share-name>
# Example
sudo mkdir -p /Volumes/user1
sudo mount -t smbfs //user1@192.168.1.100/user1 /Volumes/user1# Unmount the share
sudo umount /Volumes/<share-name>
# Example
sudo umount /Volumes/user1- Go to System Preferences → Users & Groups
- Select your user and click Login Items
- Click the + button
- Add the mounted share from
/Volumes/
- Open Files (Nautilus)
- Click Other Locations in the sidebar
- In the Connect to Server field, enter:
smb://<server-ip> - Press Enter
- Enter your username and password
- Select the share to mount
- Open Dolphin
- Enter in the address bar:
smb://<server-ip> - Enter credentials when prompted
# Install smbclient if not already installed
sudo apt update
sudo apt install cifs-utils
# Create mount point
sudo mkdir -p /mnt/<share-name>
# Mount the share
sudo mount -t cifs //<server-ip>/<share-name> /mnt/<share-name> -o username=<username>,password=<password>
# Example
sudo mkdir -p /mnt/user1
sudo mount -t cifs //192.168.1.100/user1 /mnt/user1 -o username=user1,password=mypassword# Create credentials file
sudo nano /etc/samba/credentials
# Add to the file:
username=user1
password=mypassword
domain=WORKGROUP
# Secure the file
sudo chmod 600 /etc/samba/credentials
# Mount using credentials file
sudo mount -t cifs //<server-ip>/<share-name> /mnt/<share-name> -o credentials=/etc/samba/credentials
# Example
sudo mount -t cifs //192.168.1.100/user1 /mnt/user1 -o credentials=/etc/samba/credentials# Edit fstab
sudo nano /etc/fstab
# Add line to fstab:
//<server-ip>/<share-name> /mnt/<share-name> cifs credentials=/etc/samba/credentials,uid=1000,gid=1000,iocharset=utf8 0 0
# Example:
//192.168.1.100/user1 /mnt/user1 cifs credentials=/etc/samba/credentials,uid=1000,gid=1000,iocharset=utf8 0 0
# Test the mount
sudo mount -a
# Or mount specific entry
sudo mount /mnt/<share-name># Unmount the share
sudo umount /mnt/<share-name>
# Example
sudo umount /mnt/user1# Mount with specific user/group ownership
sudo mount -t cifs //<server-ip>/<share-name> /mnt/<share-name> -o username=<username>,password=<password>,uid=1000,gid=1000
# Mount with specific permissions
sudo mount -t cifs //<server-ip>/<share-name> /mnt/<share-name> -o username=<username>,password=<password>,file_mode=0755,dir_mode=0755
# Mount with SMB version specification
sudo mount -t cifs //<server-ip>/<share-name> /mnt/<share-name> -o username=<username>,password=<password>,vers=3.0"Network path not found" or "Connection refused":
# Test if server is reachable
ping <server-ip>
# Test if Samba ports are open
telnet <server-ip> 445
# or
nc -zv <server-ip> 445
# List available shares
smbclient -L <server-ip> -U <username>Authentication errors:
# Test credentials
smbclient //<server-ip>/<share-name> -U <username>
# Check user exists on server
# (run on server)
docker exec samba-server pdbedit -LPermission denied after mounting:
- Check UID/GID mapping in docker-compose.yml
- Verify file permissions on the server
- Use uid/gid options when mounting on Linux
Linux mount options for better performance:
sudo mount -t cifs //<server-ip>/<share-name> /mnt/<share-name> -o username=<username>,password=<password>,cache=strict,rsize=1048576,wsize=1048576Windows: Disable opportunistic locking if having issues:
reg add "HKLM\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters" /v EnableOplocks /t REG_DWORD /d 0 /f- Avoid passwords in command line - use credential files or prompts
- Use strong passwords for Samba accounts
- Consider VPN for remote access instead of exposing Samba ports
- Regular updates of client systems for security patches
- Monitor access logs on the server
| OS | Quick Connect |
|---|---|
| Windows | \\<server-ip>\<share> |
| macOS | smb://<server-ip> |
| Linux | smb://<server-ip> or mount commands |
Home Network Setup:
- Server IP: 192.168.1.100
- Share: user1
- Username: user1
- Password: mypassword
Windows: \\192.168.1.100\user1
macOS: smb://192.168.1.100
Linux: sudo mount -t cifs //192.168.1.100/user1 /mnt/user1 -o username=user1