Ensure you have samba-utils installed, then run:

# mount -t cifs -o username=leo,password=53cr3T$ // /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.

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

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


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

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

Default User / Group[edit]

To set the default user/group ID, define the uid and gid value as part of the options. eg:

# mount -t cifs -o uid=1024,gid=512,credentials=/etc/cifs_passwd // /mnt/share


Unmount as usual:

# umount /mnt/share


The first time I ran mount -a, I got the following error:

root@server:~# mount -a
mount: wrong fs type, bad option, bad superblock on //box/Volume_1,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

with dmesg showing:

CIFS VFS: No username specified
CIFS VFS: cifs_mount failed w/return code = -22

Error -22 means the executable doesn't exist. To resolve this, install cifs-utils

# yum -y install cifs-utils



# mount_smbfs -I //leo@remote_host/share /mnt/share

where -I takes the remote host's IP address. Your username @ the NetBIOS name / path to your share comes next. The mount path follows after that.