Mounting Samba (CIFS) shares

From Leo's Notes
Revision as of 17:43, 23 April 2013 by Leo (talk | contribs) (Created page with "== Linux == === Mounting === Ensure you have samba-utils installed, then run: mount -t cifs -o username=leo,password=53cr3T$ //10.1.1.123/share /mnt/share You can also have ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This page was last edited on 23 April 2013, at 17:43.

Linux

Mounting

Ensure you have samba-utils installed, then run:

mount -t cifs -o username=leo,password=53cr3T$ //10.1.1.123/share /mnt/share

You can also have the secrets placed in a separate file rather than have it in line with the mount command. To do so, create a separate credentials file with the following contents:

cat /etc/cifs_passwd  # can be placed anywhere. Ensure it's not world readable.
username=leo
password=53cr3T$

Then to mount, use -o credentials=/etc/cifs_passwd like:

mount -t cifs -o credentials=/etc/cifs_passwd //10.1.1.123/share /mnt/share

If you plan on mounting it in /etc/fstab, append:

//10.1.1.123/share /mnt/share cifs credentials=/etc/cifs_passwd 0 0

Unmounting

Unmount as usual:

umount /mnt/share