This episode covers how to access Samba shares from two client sides. On Linux: mount -t cifs //host/share /mnt -o username=... for a permanent mount and smbclient //host/share for interactive access. On Windows: \\server\share, stored credentials, and network discovery. You also learn fstab mount patterns and secure options.

Your shares are alive (episodes 3-4) and the users are registered (episode 5). Now it's time to actually use them from the client side — and this is the moment real users feel. In episode 6 we cover access from two worlds: Linux clients with mount -t cifs and smbclient, and Windows clients with the UNC \\server\share, credentials, and network discovery. Being able to explain both sides is the core value of a Samba administrator.
smbclient is the fastest way to test connectivity without mounting. To browse shares on a server:
smbclient -L //fileserver -U armanTo enter a share interactively (similar to ftp):
smbclient //fileserver/data -U armanInside the smb: \> prompt you have commands like ls, cd, get, put, mkdir, and exit. It's also the most-used debugging tool in episode 16 — if smbclient fails, connections from other applications will almost certainly fail too.
For local-folder-like access, mount the share onto a directory. Install the CIFS client first:
sudo apt install -y cifs-utilsThen mount with the right identity:
sudo mount -t cifs //fileserver/data /mnt/data \
-o username=arman,uid=1000,gid=1000,vers=3.1.1Breaking down the important options:
username=arman: the Samba user used for authentication.uid=1000,gid=1000: mounted files will appear owned by these local UID/GIDs — determines permissions on the client side (remember the permission layers from episode 4).vers=3.1.1: force the SMB3.1.1 dialect — avoids insecure older versions and the "mount legacy version" warning.Check the result:
df -h /mnt/data
ls -la /mnt/dataTo survive reboots, write it into /etc/fstab. Since fstab is read before the network is ready, add the _netdev,x-systemd.automount options:
//fileserver/data /mnt/data cifs username=arman,uid=1000,gid=1000,credentials=/etc/samba/creds-data,vers=3.1.1,_netdev,x-systemd.automount,noatime 0 0Note the use of credentials=/etc/samba/creds-data — a file holding the username/password, set to chmod 600, so the password isn't visible in fstab, which anyone can read:
sudo tee /etc/samba/creds-data > /dev/null <<'EOF'
username=arman
password=S3curePass!
EOF
sudo chmod 600 /etc/samba/creds-dataTip
x-systemd.automount makes the mount happen at first access, not at boot — so a Samba server that isn't ready yet won't hang the client's boot. This is a must-use pattern for CIFS mounts on both workstations and servers. For production, also consider an explicit vers=3.1.1 option and sec=krb5 if you use winbind (episode 10).
Windows clients access shares via the UNC path: \\fileserver\data. Press Win+R, type the path, then log in with Samba credentials when prompted. You can also map it to a drive letter: net use Z: \\fileserver\data or via Map network drive in Explorer.
To avoid repeated prompts, store the credentials:
cmdkey /add:fileserver /user:arman /pass:Password
net use Z: \\fileserver\datacmdkey stores the credential in Credential Manager; after that, net use Z: succeeds without a prompt. This is also the right way to automate via scripts on Windows.
By default Windows Explorer tries to find servers via Network Discovery. Note: this feature depends on several mechanisms — DNS, WS-Discovery (port 5357), and for Samba sometimes NetBIOS (nmbd). If \\fileserver doesn't show up under "Network", that doesn't mean Samba is broken; check in this order:
ping fileserver? (DNS at the hostname)\\fileserver directly? (UNC, not browsing)The most reliable pattern in production: always access via UNC/DNS, not by relying on the Network icon — because discovery uses broadcast that doesn't cross VLANs/subnets and is influenced by many things outside Samba.
nslookup fileserver from the Windows client.credentials file isn't readable (permissions or wrong path) or uid/gid don't match.Transport endpoint is not connected: a CIFS mount left idle or with a dropped connection; unmount and remount, or use x-systemd.automount.nmbd is running and the client firewall allows it; but prioritize DNS + direct UNC.Warning
Never put an SMB password in plain text on a command line that gets recorded in shell history (history), especially with -o password=.... Use a credentials file with chmod 600, or let the interactive prompt handle it. This small habit prevents credentials from leaking to anyone who can read shell history or process logs.
Key takeaways:
smbclient -L for browsing, smbclient //host/share for interactive access.mount -t cifs ... -o username=,uid=,gid=,vers=3.1.1 for manual mounts and fstab with credentials + x-systemd.automount.\\server\share; store credentials with cmdkey.In episode 7 next, we'll cover print sharing: sharing Linux printers to the Windows network via the [printers] section, the CUPS backend, Windows printer drivers, and verification with smbclient -L localhost and a test print. From files to printing — Samba's capabilities keep growing!