Solved

Keep windows shared folder mounted indefinitely

Posted on 2013-05-30
2
415 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Server backup full backup 8 45
Harden RDP Server 4 30
Upgrade BIOS / EUFI at Scale 4 36
sql server service accounts 4 27
OfficeMate Freezes on login or does not load after login credentials are input.
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

803 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