How to auto-mount samba shares?

View previous topic View next topic Go down

How to auto-mount samba shares?

Post by beun on Wed Jun 03, 2015 8:37 pm

Hi Dejan,

If you have an answer to my question I'll be very happy!

Beun
avatar
beun

Posts : 28
Join date : 2015-05-07

Back to top Go down

Re: How to auto-mount samba shares?

Post by bluphoenyx on Fri Jun 03, 2016 10:51 am

I don't have all the relevant information for your system so a complete answer isn't possible. However, you can add the SMB share to /etc/fstab. I'm assuming that you want full time access to shares on another PC or an external file server even after a reboot. For this, enter a line in the /etc/fstab file (as root) similar to this:

//server/share /mnt/sharemnt smbfs username=username,password=password 0 0

Of course, you supply the server share name, mount point, user name and password. The share will need to be online to work right and the system may need additional packages. Testing the setup in a terminal should provide any information in case things fail. There may also be other options to add to the fstab line such as the user option so normal users can unmount and remount the share.

Note that this is not considered secure because the password is visible. The newest release of ChaletOS should access shares through the Thunar file manager so that automatically mounting them is not necessary. Using this route allows the input of user names and password if the share requires them and can remember the share if preferred.

You can get easy access to the system level files by launching Thunar as the root user from the settings panel. Caution is advised because this could trash your system if you aren't careful.

-----

Thanks for the move Mr. Tobin Smile

A update on the info I provided and I checked this with a working share on a local PC. First, the use of the smbfs file system type is deprecated. SMB mounts must be cifs. What follows is a working line from a test on a temporary setup:

//myshare/arcs2  /mnt/test1  cifs  credentials=/home/myuser/.smbcredentials 0 0

Next, create the hidden file .smbcredentials in the user's home directory.

touch ~/.smbcredentials  (or save a file from the required text editor such as mousepad)

edit the file so it contains the following information lines:

username=myuser (guest may also work)
password=userpw (actual password, an empty entry may also work for guest access)
domain=windows domain OR workgroup name (only need one)

Hope this helps any folks that need to access external SMB shares. This method is usually faster than using the gvfs system. If keeping the share mounted at all times is a problem, then add the option users to the fstab entry. You may also want to add the noauto option so that mounting the share doesn't hang the boot sequence.


Last edited by bluphoenyx on Sat Jun 04, 2016 10:42 am; edited 2 times in total
avatar
bluphoenyx

Posts : 28
Join date : 2016-05-27

Back to top Go down

Re: How to auto-mount samba shares?

Post by James Tobin on Fri Jun 03, 2016 10:58 am

topic moved to 'help and support'

___________________________________________________________________________________________________________________________________

The only good thing about Windows is that it never gives you any terminal illnesses.
Needless to say, Terminal illnesses are the only problem with Linux.
avatar
James Tobin

Posts : 691
Join date : 2016-05-05
Location : United States

https://tobinbridge.zohosites.com/

Back to top Go down

Re: How to auto-mount samba shares?

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum