Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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)
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.
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, 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.
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.
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
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.