windows shared folder with password – auto mount in linux folder


activated password protected sharing

control panel => network and sharing center => advanced sharing settings

01. activated password protected sharing

create user and password for shared folder

windows + r => netplwiz

02.00 manage user

create user ushare, pass ushare, group Distributed COM Users

02.01 create user com

create shared folder

right click => properties => tab Sharing => Advanced Sharing => Permissions => Add

03.00 create shared folder

input ushare => click Check Names => then Ok Ok Ok Ok

03.01 input ushare click check names and ok

fill shared folder with file

04 shared folder


CIFS installation

$ sudo apt-get install cifs-utils

On older systems:

sudo apt-get install smbfs

create folder for mount

$ sudo mkdir -p /media/windowsshare

first, create example script mount in /etc/fstab

$ sudo nano /etc/fstab

add this line

# mounting share folder windows to linux
 // /media/windowsshare cifs username=ushare,password=ushare,iocharset=utf8,sec=ntlm 0 0

# or with user and group for read and write
 // /media/windowsshare cifs username=ushare,password=ushare,uid=yourlinuxuser,gid=yourlinuxgroup,iocharset=utf8,sec=ntlm 0 0

save and test with

$ sudo mount -a && ls /media/windowsshare

or we can create file config in secure place

$ nano ~/.smbcredentials

Change the permissions of the file to prevent unwanted access to your credentials:

$ chmod 600 ~/.smbcredentials

edit in /etc/fstab

// /media/windowsshare cifs credentials=/home/g3n1k/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

save and test

$ sudo mount -a && ls /media/windowsshare

Screenshot - 01132016 - 12:02:04 AM


Published by


just to remember what i had known :)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s