FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Education

 
 
LinkBack Thread Tools
 
Old 04-27-2010, 09:51 PM
Simón Ruiz
 
Default Mounting a shared folder in everyone's home directory

On Tue, Apr 27, 2010 at 4:39 PM, David Groos <djgroos@gmail.com> wrote:
> Hi Simon,
>
>> I'm beginning to believe you're using LTSP?
>
> Yes.

Ah! Makes so much more sense, now. :-)

At our school every user is on their own workstation, authenticating
logins off a Samba server and mounting their home folders and shared
folders off another Samba server.

We can't manipulate student's home folders because they're created
from scratch at login, and students seldom log into the same computer
twice, so we mount Samba servers dynamically on login and unmount them
on logout.

>> Here's my idea/suggestion, leaving in step 2, forgetting about
>> Symlinks, and moving forward from there (I'm also checking the "Guest
>> access" checkbox when I create the share on my Desktop.):
>
> I don't understand why you are checking the "Guest access" checkbox when you
> create the share on your desk because as I understand it in the next step
> you are creating the folder to be shared.

I am checking the "Guest access" checkbox so that later when we mount
it (particularly if we want to mount it automatically after reboots in
the future), we can specify that we're mounting as "guest" and not
have to bother with logging in. If that's not checked, we'll need to
log in as a specific, valid, local user when we mount it.

I do this because that information is intended to be easily accessible
to all; I would *not* make it "Guest access" if it was important for
people who *didn't* have a local account *not* to have access to it.

That's the "side-effect", here: now anyone can mosey on over to your
computer, see that you are sharing something called "Dogs", and look
through it. I figure, if anything, this is a good thing.

>> 3. "sudo mkdir /media/Dogs" - Create a folder to use as a mountpoint
>> in the /media directory
>
> Did this and it worked fine.

Actually, here I'm not creating the folder to be shared, I'm creating
the mount point; that is, the local place (USUALLY an empty folder)
where the "remote" share's contents will appear.

The folder to be shared, the place you actually want to put the files
you're sharing, is still /home/your_username/Desktop/DogTraits

>> 4. "sudo mount -t cifs -o guest //localhost/Dogs /media/shared" -
>> Mounts the Samba share (using your loopback device; this won't slow
>> down networking at all) to the folder "/media/Dogs"

First of all, I mis-spoke in the above sentence, it was *meant* to
say: Mounts the Samba share "//localhost/Dogs" to the folder
"/media/shared"

> Did this and got the following output: http://pastebin.com/JPf22tCi so looks
> like it didn't work.* Any ideas?* I've got no immediate deadline but need to
> solve this.* Also, I'd really like to set up an edubuntu wiki page about
> 'file sharing schemes for teachers' or something.* Any help on
> naming/locating that page would be helpful.

I can see the primary issue below:

mrg@gcos2:~$ sudo sudo mount -t cifs -o guest//localhost/DogImages /media/shared

You didn't place a space between the word "guest" and the first "/" of
"//localhost/DogImages". Mount is trying to figure out what the option
"guest//localhost/DogImages" is. ;-)

The next problem would be that you're trying to mount the "remote"
share to "/media/shared"; replace "/media/shared" here with
"/media/DogImages", as that's the empty folder you just created.

The next thing I see that *might* be a problem, unless you've changed
something, is that you're trying to mount "//localhost/DogImages" when
before you mentioned that you named the share "Dogs". Replace this
with "//localhost/Dogs" if that's still true.

So: sudo mount -t cifs -o guest //localhost/SHARE_NAME
/media/EMPTY_MOUNTPOINT_FOLDER_NAME

Becomes: sudo mount -t cifs -o guest //localhost/Dogs /media/DogImages

Based on the info you've given us so far.

Let me know if that's any better/clearer. :-)

> Thanks
> David

P.S. And, just in case it comes up: you might need to "sudo apt-get
install smbfs" before this works; I don't recall exactly.

--
ubuntu-education mailing list
ubuntu-education@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-education
 
Old 04-27-2010, 10:36 PM
David Groos
 
Default Mounting a shared folder in everyone's home directory

Thanks for all this info! I'll give this a go again when I get to
school tomorrow AM.
David

On Apr 27, 2010, at 4:51 PM, Simón Ruiz wrote:

> On Tue, Apr 27, 2010 at 4:39 PM, David Groos <djgroos@gmail.com>
> wrote:
>> Hi Simon,
>>
>>> I'm beginning to believe you're using LTSP?
>>
>> Yes.
>
> Ah! Makes so much more sense, now. :-)
>
> At our school every user is on their own workstation, authenticating
> logins off a Samba server and mounting their home folders and shared
> folders off another Samba server.
>
> We can't manipulate student's home folders because they're created
> from scratch at login, and students seldom log into the same computer
> twice, so we mount Samba servers dynamically on login and unmount them
> on logout.
>
>>> Here's my idea/suggestion, leaving in step 2, forgetting about
>>> Symlinks, and moving forward from there (I'm also checking the
>>> "Guest
>>> access" checkbox when I create the share on my Desktop.):
>>
>> I don't understand why you are checking the "Guest access"
>> checkbox when you
>> create the share on your desk because as I understand it in the
>> next step
>> you are creating the folder to be shared.
>
> I am checking the "Guest access" checkbox so that later when we mount
> it (particularly if we want to mount it automatically after reboots in
> the future), we can specify that we're mounting as "guest" and not
> have to bother with logging in. If that's not checked, we'll need to
> log in as a specific, valid, local user when we mount it.
>
> I do this because that information is intended to be easily accessible
> to all; I would *not* make it "Guest access" if it was important for
> people who *didn't* have a local account *not* to have access to it.
>
> That's the "side-effect", here: now anyone can mosey on over to your
> computer, see that you are sharing something called "Dogs", and look
> through it. I figure, if anything, this is a good thing.
>
>>> 3. "sudo mkdir /media/Dogs" - Create a folder to use as a mountpoint
>>> in the /media directory
>>
>> Did this and it worked fine.
>
> Actually, here I'm not creating the folder to be shared, I'm creating
> the mount point; that is, the local place (USUALLY an empty folder)
> where the "remote" share's contents will appear.
>
> The folder to be shared, the place you actually want to put the files
> you're sharing, is still /home/your_username/Desktop/DogTraits
>
>>> 4. "sudo mount -t cifs -o guest //localhost/Dogs /media/shared" -
>>> Mounts the Samba share (using your loopback device; this won't slow
>>> down networking at all) to the folder "/media/Dogs"
>
> First of all, I mis-spoke in the above sentence, it was *meant* to
> say: Mounts the Samba share "//localhost/Dogs" to the folder
> "/media/shared"
>
>> Did this and got the following output: http://pastebin.com/
>> JPf22tCi so looks
>> like it didn't work. Any ideas? I've got no immediate deadline
>> but need to
>> solve this. Also, I'd really like to set up an edubuntu wiki page
>> about
>> 'file sharing schemes for teachers' or something. Any help on
>> naming/locating that page would be helpful.
>
> I can see the primary issue below:
>
> mrg@gcos2:~$ sudo sudo mount -t cifs -o guest//localhost/DogImages /
> media/shared
>
> You didn't place a space between the word "guest" and the first "/" of
> "//localhost/DogImages". Mount is trying to figure out what the option
> "guest//localhost/DogImages" is. ;-)
>
> The next problem would be that you're trying to mount the "remote"
> share to "/media/shared"; replace "/media/shared" here with
> "/media/DogImages", as that's the empty folder you just created.
>
> The next thing I see that *might* be a problem, unless you've changed
> something, is that you're trying to mount "//localhost/DogImages" when
> before you mentioned that you named the share "Dogs". Replace this
> with "//localhost/Dogs" if that's still true.
>
> So: sudo mount -t cifs -o guest //localhost/SHARE_NAME
> /media/EMPTY_MOUNTPOINT_FOLDER_NAME
>
> Becomes: sudo mount -t cifs -o guest //localhost/Dogs /media/DogImages
>
> Based on the info you've given us so far.
>
> Let me know if that's any better/clearer. :-)
>
>> Thanks
>> David
>
> P.S. And, just in case it comes up: you might need to "sudo apt-get
> install smbfs" before this works; I don't recall exactly.


--
ubuntu-education mailing list
ubuntu-education@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-education
 
Old 04-29-2010, 01:44 PM
David Groos
 
Default Mounting a shared folder in everyone's home directory

Got it!* Thanks for your help, Simon.* Here were the steps, feel free to edit/improve/annotate them as useful--I'll be making a simple wiki page on this.

1.* sudo apt-get install smbfs
2.* Make folder on my desktop, named it, "dogimages" (not sure if must be lower case)

3.* Right-clicked and selected Sharing Options, selected, Share this folder and Guest access. (little flag appears on folder--I'm using Jaunty).
4.* Make the mount point-- sudo mkdir /media/dogimages (Directory name must be all lowercase, it seems)

5.* sudo mount -t cifs -o guest //localhost/dogimages /media/dogimages
6* And a sharepoint mounted on my desktop! (is it called, 'sharepoint'?* I was looking for a word to distinguish it from the folder created in step 2)

7. I added an image to the shared folder that I had created in step 2 and the image appeared in the mounted sharepoint

This is great.* Thanks for the detailed info.

My next step (I'm not in a rush to do this) is that I will want to be able to fine tune on whose desktop this shows up.* I want to be able to manage this by group membership.* In other words I've got a group on my server called, "period2".* I want to similarly mount a shared folder on the desktop of just members of that group.* Is it very complex task?


David

On Tue, Apr 27, 2010 at 5:36 PM, David Groos <djgroos@gmail.com> wrote:

Thanks for all this info! *I'll give this a go again when I get to school tomorrow AM.

David



On Apr 27, 2010, at 4:51 PM, Simón Ruiz wrote:




On Tue, Apr 27, 2010 at 4:39 PM, David Groos <djgroos@gmail.com> wrote:


Hi Simon,




I'm beginning to believe you're using LTSP?




Yes.




Ah! Makes so much more sense, now. :-)



At our school every user is on their own workstation, authenticating

logins off a Samba server and mounting their home folders and shared

folders off another Samba server.



We can't manipulate student's home folders because they're created

from scratch at login, and students seldom log into the same computer

twice, so we mount Samba servers dynamically on login and unmount them

on logout.





Here's my idea/suggestion, leaving in step 2, forgetting about

Symlinks, and moving forward from there (I'm also checking the "Guest

access" checkbox when I create the share on my Desktop.):




I don't understand why you are checking the "Guest access" checkbox when you

create the share on your desk because as I understand it in the next step

you are creating the folder to be shared.




I am checking the "Guest access" checkbox so that later when we mount

it (particularly if we want to mount it automatically after reboots in

the future), we can specify that we're mounting as "guest" and not

have to bother with logging in. If that's not checked, we'll need to

log in as a specific, valid, local user when we mount it.



I do this because that information is intended to be easily accessible

to all; I would *not* make it "Guest access" if it was important for

people who *didn't* have a local account *not* to have access to it.



That's the "side-effect", here: now anyone can mosey on over to your

computer, see that you are sharing something called "Dogs", and look

through it. I figure, if anything, this is a good thing.





3. "sudo mkdir /media/Dogs" - Create a folder to use as a mountpoint

in the /media directory




Did this and it worked fine.




Actually, here I'm not creating the folder to be shared, I'm creating

the mount point; that is, the local place (USUALLY an empty folder)

where the "remote" share's contents will appear.



The folder to be shared, the place you actually want to put the files

you're sharing, is still /home/your_username/Desktop/DogTraits





4. "sudo mount -t cifs -o guest //localhost/Dogs /media/shared" -

Mounts the Samba share (using your loopback device; this won't slow

down networking at all) to the folder "/media/Dogs"




First of all, I mis-spoke in the above sentence, it was *meant* to

say: Mounts the Samba share "//localhost/Dogs" to the folder

"/media/shared"




Did this and got the following output: http://pastebin.com/JPf22tCi so looks

like it didn't work. *Any ideas? *I've got no immediate deadline but need to

solve this. *Also, I'd really like to set up an edubuntu wiki page about

'file sharing schemes for teachers' or something. *Any help on

naming/locating that page would be helpful.




I can see the primary issue below:



mrg@gcos2:~$ sudo sudo mount -t cifs -o guest//localhost/DogImages /media/shared



You didn't place a space between the word "guest" and the first "/" of

"//localhost/DogImages". Mount is trying to figure out what the option

"guest//localhost/DogImages" is. ;-)



The next problem would be that you're trying to mount the "remote"

share to "/media/shared"; replace "/media/shared" here with

"/media/DogImages", as that's the empty folder you just created.



The next thing I see that *might* be a problem, unless you've changed

something, is that you're trying to mount "//localhost/DogImages" when

before you mentioned that you named the share "Dogs". Replace this

with "//localhost/Dogs" if that's still true.



So: sudo mount -t cifs -o guest //localhost/SHARE_NAME

/media/EMPTY_MOUNTPOINT_FOLDER_NAME



Becomes: sudo mount -t cifs -o guest //localhost/Dogs /media/DogImages



Based on the info you've given us so far.



Let me know if that's any better/clearer. :-)




Thanks

David




P.S. And, just in case it comes up: you might need to "sudo apt-get

install smbfs" before this works; I don't recall exactly.






--
ubuntu-education mailing list
ubuntu-education@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-education
 
Old 04-29-2010, 02:37 PM
Chan Chung Hang Christopher
 
Default Mounting a shared folder in everyone's home directory

> 5. sudo mount -t cifs -o guest //localhost/dogimages /media/dogimages

Or stick that in /etc/fstab


>
> My next step (I'm not in a rush to do this) is that I will want to be
> able to fine tune on whose desktop this shows up. I want to be able to
> manage this by group membership. In other words I've got a group on my
> server called, "period2". I want to similarly mount a shared folder on
> the desktop of just members of that group. Is it very complex task?
>

Are you running Hardy and KDE 3.5? kiosktool makes it easy to customize
desktops based on groups. You can control what they see like whether
they can see shares. Otherwise, it would probably involve some serious
scripting.

--
ubuntu-education mailing list
ubuntu-education@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-education
 
Old 04-29-2010, 08:38 PM
Simón Ruiz
 
Default Mounting a shared folder in everyone's home directory

On Thu, Apr 29, 2010 at 9:44 AM, David Groos <djgroos@gmail.com> wrote:
> Got it!* Thanks for your help, Simon.* Here were the steps, feel free to
> edit/improve/annotate them as useful--I'll be making a simple wiki page on
> this.
>
> 1.* sudo apt-get install smbfs
> 2.* Make folder on my desktop, named it, "dogimages" (not sure if must be
> lower case)
> 3.* Right-clicked and selected Sharing Options, selected, Share this folder
> and Guest access. (little flag appears on folder--I'm using Jaunty).
> 4.* Make the mount point-- sudo mkdir /media/dogimages (Directory name must
> be all lowercase, it seems)

The case shouldn't matter as far preventing a name choice, so long as
you consistently refer to it by the same name.

Linux file-systems are case-sensitive so "/media/Dogs" is a different
directory than, and can exist next to, "/media/dogs" and
"/media/dogS".

Here, I've got /home/username/Desktop/Dogs shared via samba as the
share name "Dogs", and mounted on /media/Dogs

> 5.* sudo mount -t cifs -o guest //localhost/dogimages /media/dogimages
> 6* And a sharepoint mounted on my desktop! (is it called, 'sharepoint'?* I
> was looking for a word to distinguish it from the folder created in step 2)

A shortcut? A link? An icon? There's probably a particularly good word
for it, but I can't think of it myself.

> 7. I added an image to the shared folder that I had created in step 2 and
> the image appeared in the mounted sharepoint

Also, you might want to verify that you can't delete the photo through
the mounted share, just to double-check your permissions.

> This is great.* Thanks for the detailed info.

Glad to be of help.

> My next step (I'm not in a rush to do this) is that I will want to be able
> to fine tune on whose desktop this shows up.* I want to be able to manage
> this by group membership.* In other words I've got a group on my server
> called, "period2".* I want to similarly mount a shared folder on the desktop
> of just members of that group.* Is it very complex task?

Heheh, now you're moving up the ladder.

It's slightly more complex up front to set up, but it ends up being
easier to maintain.

You could set up pam_mount, which is designed to integrate into the
system's logon process and take care of mounting things on login (and
unmounting them on logout) based on any number of conditions (hey,
sounds like what you wanna do). ;-)

First you gotta install the package "libpam-mount", then you gotta
edit it into your /etc/pam.d config files to exhibit the desired
behavior...

A copy of the official documentation for doing that is at
<http://manpages.ubuntu.com/manpages/karmic/man8/pam_mount.8.html>,
but I don't know how easy that will be to follow.

You can see my notes on how I integrated pam_mount into our config
files under Hardy Heron over at
<http://tech.canterburyschool.org/tech/UbuntuWorkstations/AuthenticationSetup>;
we were also integrating winbind authentication, too, and those config
files are a little old so I don't suggest trying to copy what we did
verbatim, but they might serve as illustrative in that I inserted one
line into common-auth and one into common-session.

Once you have it integrated into the login process, you simply edit
the /etc/security/pam_mount.conf.xml to add the shares you want
auto-mounted.

In our documentation above, I only added the user's home folder being
mounted over Samba, but pam_mount is able to be set up to mount all
kinds of stuff, including local bind mounts (removing the need for
running a Samba share if all you care about is sharing things on the
local drive), and conditional mounting (so you can specify different
mounts for different users).

Say you get pam_mount installed and running, then you edit the
pam_mount.conf.xml script with a volume tag such as...

<volume path="/home/teacher/Desktop/Dogs" mountpoint="~/Desktop/Dogs"
options="bind" />

Now anyone who logs in will automatically have the
/home/teacher/Desktop/Dogs folder "bound" ("binded"?) to their own
~/Desktop/Dogs folder.

Then you decide only "period2" should have that mounted? No problem,
just add one option to that line and turn it into:

<volume path="/home/teacher/Desktop/Dogs" mountpoint="~/Desktop/Dogs"
options="bind" sgrp="period2" />

Now it checks to see if the user is in the group "period2", and mounts
this volume only if they are.

Period 3 is studying cats, you say? Just add:

<volume path="/home/teacher/Desktop/Cats" mountpoint="~/Desktop/Cats"
options="bind" sgrp="period3" />

At this point, you're not even pretending to use the network anymore
so the Samba server or smbfs mounting packages are not involved, and
don't need to be installed.

You will need to make sure that the shared folders have sane file
permissions (which they should by default, but you could run "chmod -R
755 /home/Desktop/Cats" to be sure); as readable to all, but not
writable by anyone but the owner).

You can check out a copy of the pam_mount.conf manual over at
<http://manpages.ubuntu.com/manpages/karmic/man5/pam_mount.conf.5.html>
to see all the other shiny knobs and levers it has.

Hope this helps,

> David

Simón

--
ubuntu-education mailing list
ubuntu-education@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-education
 

Thread Tools




All times are GMT. The time now is 05:30 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org