Linux mount CIFS Windows Share

by on January 6, 2008 · 16 comments· LAST UPDATED November 16, 2008

in , ,

Q. How do I mount CIFS Windows Server / XP / Vista Shared folder under Linux operating systems?

A. Common Internet File System is an application-level network protocol mainly used to provide shared access to files, printers, serial ports, and miscellaneous communications between nodes on a network. You can easily access CIFS share from Linux and mount them as a regular filesystem.

Mount Linux CIFS share

Mount CIFS with the default local filesystem permissions:
# mkdir /mnt/cifs
# mount -t cifs //server-name/share-name /mnt/cifs -o username=shareuser,password=sharepassword,domain=nixcraft
# mount -t cifs // /mnt/cifs -o username=shareuser,password=sharepassword,domain=nixcraft

# mount.cifs // /mnt/cifs -o username=shareuser,password=sharepassword,domain=nixcraft

  • username=shareuser : specifies the CIFS user name.
  • password=sharepassword : specifies the CIFS password. If this option is not given then the environment variable PASSWD is used. If the password is not specified directly or indirectly via an argument to mount, mount will prompt for a password, unless the guest option is specified.
  • domain=nixcraft : sets the domain (workgroup) of the user
Tweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?

{ 16 comments… read them below or add one }

1 ekram October 29, 2010 at 5:16 am

i can mount windows share when using gnome mount.
but if i use CLI then how to mount without password since there is no password required for my windows share..



2 dave November 10, 2010 at 1:14 pm

use the guest option.
help is available from the CLI with:
man mount.cifs


3 suhasini January 12, 2012 at 6:36 am

When i am performing mounting, it giving me error like cifs file system not found


4 Brad Mccormack February 17, 2012 at 9:00 am

Do you have samba installed?


5 Préstamos - Republica Dominicana February 28, 2012 at 9:39 pm

Thank you, this article really helped me!


6 Drew April 12, 2012 at 5:04 pm

How can you specify username/pw in /etc/fstab for automatic mounting?


7 Arun Mummidi June 12, 2012 at 1:46 pm

@Drew: You can add a line similar to below to /etc/fstab

//WindowsHost/Sharename /LocalMountPoint cifs username=,credentials=/etc/cifsauth{any file},domain=[workgroup/WindowsHostName/Most of the time can be left blank] 0 0

Two zeros at end of line are important as it will prevent boot failure when windows share is unavailable.

Format of credentials file (/etc/cifsauth)


8 amit bajaj February 22, 2013 at 5:51 am

This article is very helpful can we permanent mount this ??????????????


9 risha April 19, 2013 at 7:00 am

how to mount a ubuntu share on ubuntu using command line?


10 KaptaiKK June 24, 2013 at 7:23 pm

Works.Supercool Vivek !


11 Sudheer July 17, 2013 at 9:14 am
mount -t cifs //[netbiosname]/techsupport /mnt/techupport -o username=[username],doamin=[name],rw,file_mode=0777,dir_mode=0777

mount with write permisssion


12 Sudheer November 1, 2013 at 12:28 pm

Mount in cifs in AIX
mount -v cifs -n\!12 -o wrkgrp=commvault-nj /recutstotest /mnt

use ‘\’ if your password contains escape sequence


13 fahad November 3, 2013 at 11:45 am

thanks a lot.


14 ibanez1998 December 9, 2013 at 9:01 pm

…and what if the folder you’re mounting on the windows share has a space in it? //storageserver/old%20work?


15 Arthur December 18, 2013 at 9:12 pm

//storageserver/old\ work

Just in case a formatting problem crops up, that’s backslash space between old and work.


16 Ramesh November 17, 2014 at 2:25 pm

Thanks this helps me more.


Leave a Comment

Tagged as: , , , , , , , , ,

Previous Faq:

Next Faq: