Solved

Keep windows shared folder mounted indefinitely

Posted on 2013-05-30
2
418 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

Question has a verified solution.

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

Will try to explain how to use the VMware feature TAGs in the VMs and create Veeam Backup Jobs using TAGs. Since this article is too long, I will create second article for the Veeam tasks.
Fine Tune your automatic Updates for Ubuntu / Debian
How to install and configure Citrix XenApp 6.5 - Part 1. In this video tutorial we have explained step by step installation of Citrix XenApp 6.5 Server on Windows Server 2008 R2 is explained in this video. We have explained the difference between…
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.

687 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