LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-25-2012, 08:54 PM   #1
nglbrkr
Member
 
Registered: May 2005
Location: hiroshima
Distribution: debian
Posts: 75
Blog Entries: 9

Rep: Reputation: 17
Mulitiuser Network Mount


Hello

I work in a school where we have a bunch of laptops. I am about to reformat them to autologin to a desktop. I haven't decided what to use yet - possibly lxde on debian or a derivative.

Kids all have NFS/SMB/SSH shares on a central server (server/homes/username). I want to have a script (attached to an icon or launcher) to collect the username and pw, and mount the remote home share, which will unmount cleanly when they logout or shutdown the laptop. Browsing network shares is a little involved - some kids are really young.

So my question is mostly what kind of mount should I be trying? And then how would I achieve the mount and unmount?

thanks!
 
Old 02-27-2012, 03:59 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
You probably want to look at autofs .. a script to collect usernames and passwords is probably not the best path to go down.
 
Old 02-27-2012, 07:10 PM   #3
nglbrkr
Member
 
Registered: May 2005
Location: hiroshima
Distribution: debian
Posts: 75
Blog Entries: 9

Original Poster
Rep: Reputation: 17
How can autofs collect login credentials for the user each time? Its not just username and pw, but also some path info (basically a group number, from the user point of view)
 
Old 02-27-2012, 09:04 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
You shouldn't require individual credentials to mount a remote volume, you'll probably need to be a little more specific in how you're wanting to impliment this.
 
Old 02-27-2012, 09:32 PM   #5
nglbrkr
Member
 
Registered: May 2005
Location: hiroshima
Distribution: debian
Posts: 75
Blog Entries: 9

Original Poster
Rep: Reputation: 17
The shares are like this

server/homes/group/user

so user1 can't access user2's home.

this line will achieve the mount:
Code:
sshfs user1@server:/homes/group1/user1 /home/laptop/mountpoint
how would I get that information into autofs? I know there is a credentials file option, and I could populate that by a script, but how would I get the group into the path?

When you say autofs doesn't need credentials, how is it going to know which share to mount, and how will it stop people mounting others' folders?

Sorry if I'm not clear about it
 
Old 02-28-2012, 04:52 AM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Sorry, I didn't notice that you mentioned sshfs but this is also supported in certain configurations, you'll need to read up to see if autofs will suit your needs. You mentioned several types of shares and I'm guessing they all use different authentication schemes as well.. there is plenty of doco and example configs, try setting up a test server and see if you can get it all working the way you want.
 
Old 02-28-2012, 06:10 AM   #7
nglbrkr
Member
 
Registered: May 2005
Location: hiroshima
Distribution: debian
Posts: 75
Blog Entries: 9

Original Poster
Rep: Reputation: 17
Really I was looking for advice as to what to try. Doesn't have to be sshfs. Could be samba. A few years ago I had problems with openoffice over samba - asking for the pw sometimes, sometimes not saving. However, in testing these past few days, it seems ok.

In the meantime this is where I'm up to:
I have a python script to gather user details and check that the share exists on the server. Works.

nfs and autofs - I can't understand how to do it, and I'm running out of time.

sshfs or sftp - I can do it from the command line but can't script it from python, yet

samba - works through remote share browsing in PCmanFM, but when the window is closed, the mount point is gone (actually its in .gvfs). I am going to try to script the mount and link the mount point to an icon next.

gvfs might save me, by the look of it, either with samba or ssh.

I have settled on lubuntu, because it looks good, works fast, detects all the hardware, and has easy to use login and out scripts that I can use for unmounting, clearing settings, etc.

Anyway, thanks for trying to help. I will post again when finished.
 
Old 02-29-2012, 07:45 AM   #8
nglbrkr
Member
 
Registered: May 2005
Location: hiroshima
Distribution: debian
Posts: 75
Blog Entries: 9

Original Poster
Rep: Reputation: 17
Eventually had to settle for samba, because pcmanfm and gvfs-mount both mount the root of the sftp server, and not the path of the share.

Overall flow:
1. /etc/lxdm/PreLogin script clears the settings, clears the desktop, and makes sure scripts are in place, including a desktop launcher for the python script
2. Python script to get the username, check it against the server, and build the desktop launcher for the mount. Then removes its own launcher and creates a desktop link to .gvfs
3. desktop launcher executes pcmanfm smb://server/user, which collects credentials and performs the mount.
4. /etc/lxdm/PostLogout script unmounts the share

Seems to do what I wanted - nice clean computer for each login, but mounts the remote home of any user without browsing or typing paths.
Now to test in in the field
 
1 members found this post helpful.
Old 01-19-2013, 04:49 PM   #9
rootyourbrain
LQ Newbie
 
Registered: Dec 2012
Posts: 7

Rep: Reputation: Disabled
Quote:
Originally Posted by nglbrkr View Post
Eventually had to settle for samba, because pcmanfm and gvfs-mount both mount the root of the sftp server, and not the path of the share.

Overall flow:
1. /etc/lxdm/PreLogin script clears the settings, clears the desktop, and makes sure scripts are in place, including a desktop launcher for the python script
2. Python script to get the username, check it against the server, and build the desktop launcher for the mount. Then removes its own launcher and creates a desktop link to .gvfs
3. desktop launcher executes pcmanfm smb://server/user, which collects credentials and performs the mount.
4. /etc/lxdm/PostLogout script unmounts the share

Seems to do what I wanted - nice clean computer for each login, but mounts the remote home of any user without browsing or typing paths.
Now to test in in the field
Sorry, I just stumbled upon this from Google. This is very similar to what I need to do. I just don't know where to begin....

Can you tell me exactly what you did to make this work. The posts seem a bit unclear.
I need these computers to do exactly what yours do... SERVER/DIR: "170.X.X.X/Shared" needs to be available to multiple users when they sign in.
Can you please provide the script that you used to get this going?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
mount network drives pexji Fedora 4 11-21-2010 09:30 AM
smb mount folders disappear on mount & konqueror smb fails: network unreachable tisource Linux - Networking 1 10-17-2007 12:30 AM
Xandros mount point for Windows Network & NFS Network jaagut Linux - Distributions 1 09-14-2005 07:21 AM
How can i mount to the network drive? yenonn Linux - Newbie 1 02-25-2003 10:33 PM
Cannot mount an NT network share pharpe Linux - Networking 3 04-29-2002 07:58 AM


All times are GMT -5. The time now is 11:40 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration