LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-11-2018, 03:17 PM   #1
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Rep: Reputation: 33
Mounting a samba shared folder at boot time.


Hello!

IŽll try to be as clear as possible with the explanation.

I'm an ICT teacher using both Windows and Linux on the same network.

At work we have a file server called servidor (running Ubuntu) with two folders:
publica (pass 1234) and material (pass=xxxx).

This folders are shared through samba to windows computers. Now I am installing new Linux computers in this network. One of them with Lubuntu 17.10 and three more with Ubuntu 16.04LTS.

What I want to do is to access those folders from Lubuntu computer and mount them at boot time to have them on the desktop.

What I tried to do is this:
1) sudo apt install cifs-utils
2) sudo mkdir /mnt/publica and sudo mkdir /mnt/material
3) IŽve edited fstab (sudo nano /etc/fstab) and added this two lines at the end of fstab:
//servidor/publica/mnt/samba cifs username=alumnos,password=1234 0 0
and
//servidor/material/mnt/samba cifs username=profes,password=xxxx 0 0

4) I saved fstab and restarted the computer but it didn't work: Folders are not mounted and /mnt/publica and /mnt/material are both empty.

What am I doing wrong or what am I missing to do?

I will appreciate any kind of help on this.

Thanks in advance,
Glore2002
 
Old 04-11-2018, 03:42 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
It appears you're missing the space between the "device" (the URI of the share) and the "mount point" (the directory on the local server. You've also used "samba" as subdirectory of /mnt but say you created publica and material. So it should be:

Code:
//servidor/publica     /mnt/publica cifs username=alumnos,password=1234 0 0

//servidor/material    /mnt/material cifs username=profes,password=xxxx 0 0
Alternatively your shares' URIs are actually as you wrote them and you simply left out the mount points.
Code:
//servidor/publica/mnt/samba     /mnt/publica cifs username=alumnos,password=1234 0 0

//servidor/material/mnt/samba    /mnt/material cifs username=profes,password=xxxx 0 0
By the way - you don't have to reboot to test whether they mount. Typing "mount /mnt/publica" should read your fstab entry to mount that and "mount /mnt/material" would do the same for the other mount. "mount -a" says to mount everything in fstab so would mount both. It doesn't do anything to filesystems that are already mounted so is a quick way to test updates to fstab.

Last edited by MensaWater; 04-11-2018 at 03:46 PM.
 
1 members found this post helpful.
Old 04-12-2018, 03:22 PM   #3
glore2002
Member
 
Registered: Mar 2007
Location: Buenos Aires, Argentina.
Distribution: Lubuntu 17.10 x64
Posts: 510

Original Poster
Rep: Reputation: 33
Smile

Thanks MensaWater for your help! It worked. Instead of using servidor I've used the IP (192.168.1.200). With servidor it didn't work but with the ip yes! :-)

The problem I am facing now is how to give the folders right to be written and read: publica should be readable and writable by all users (alumnos and profesores) and material only RW by profesores and only readable for alumnos. Is this clear? :-)

Thanks agani for such valuable help!!!
 
Old 04-16-2018, 11:10 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
If you run "man mount.cifs" you see other options you can add including for user ID, group ID and permissions. You'd setup using those options in tandem with setup of users in /etc/password and group assignments in /group.

If you want a specific user to own the cifs mount you'd use its uid in options. If you want members of group to have access you use that groups gid in options. You'd set permissions in options appropriate to the level of access you want the user and group to have.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora 17 auto mounting Windows network shared folder Anubis Fedora 3 02-19-2014 02:17 PM
problems with mounting a windows 7 shared folder in linux izrafel Linux - Networking 1 06-14-2012 03:10 PM
Samba shared folder klmn1 Linux - Server 5 08-20-2008 04:22 AM
Samba shared folder configuration Fubuki Linux - Software 0 08-13-2008 04:54 AM
trouble mounting linux shared folder jerryfreak Linux - Networking 1 10-15-2004 12:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 07:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration