Mount Windows Share in Linux

On Ubuntu, install cifs-utils

apt-get install cifs-utils

First create a directory on which we can mount the windows share

mkdir /media/SHARE_NAME

Now create a file to store windows share username and password.

vi /etc/SHARE_NAME.smbcredentials

Add following to the file


Now run

mount -t cifs // /media/SHARE_NAME -o credentials=/etc/SHARE_NAME.smbcredentials,uid=LINUX_USER_NAME,iocharset=utf8,sec=ntlm,rw,dir_mode=0777,file_mode=0666 – Replace with IP of your Windows computer with share.

LINUX_USER_NAME – Replace with the Linux user name you want the files to be owned.

To make share mounted on boot, edit

vi /etc/fstab


//  /media/SHARE_NAME  cifs  credentials=/etc/SHARE_NAME.smbcredentials,uid=LINUX_USER_NAME,gid=GID_OF_LINUX_USER,_netdev,iocharset=utf8,dir_mode=0777,file_mode=0666  0  0


Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *