Solved

Keep windows shared folder mounted indefinitely

Posted on 2013-05-30
2
416 Views
Last Modified: 2013-05-30
In a previous question, I needed to have a 64 bit 12.04 ubuntu server client that hosted on a hypervisor host have access to a shared folder.  

That has been solved.  

Now I just need to know how to keep that mounted, and/or to have that mounted on boot so that in the event of a crash it will come back up.
0
Comment
Question by:Illyankesh
2 Comments
 
LVL 4

Accepted Solution

by:
Rsilva98 earned 500 total points
ID: 39208465
what type of share u have ? samba? cifs?

Never the less you can create add it in your edit /etc/fstab file.

Example: //servername/sharename  /media/windowsshare  cifs  username=msusername,password=mspassword,iocharset=utf8,sec=ntlm  0  0

Note the user and password will be exposed since the fstab is readable.

You can do this to prevent it

gedit ~/.smbcredentials

Enter your Windows username and password in the file:

username=msusername
password=mspassword

Save the file, exit the editor.

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

chmod 600 ~/.smbcredentials

Then edit your /etc/fstab file (with root privileges) to add this line (replacing the insecure line in the example above, if you added it):

//servername/sharename /media/windowsshare cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8,sec=ntlm 0 0

test the fstab entry by issuing:

sudo mount -a

If there are no errors, you should test how it works after a reboot. Your remote share should mount automatically.
0
 

Author Closing Comment

by:Illyankesh
ID: 39208712
You are the man  :)   thanks for such a detailed, and accurate answer, in such a ridiculously short amount of time.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
In this Micro Tutorial viewers will learn how to restore single file or folder from Bare Metal backup image of their system. Tutorial shows how to restore files and folders from system backup. Often it is not needed to restore entire system when onl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question