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.
A little background to this question: I'm working on a project to extend the life of around 1000 notebooks that are currently running Windows XP. Because of budget concerns we can't replace or update them to a newer version of Windows, but continuing to run them on XP is no longer an option. I voiced the possibility of putting Linux on them and, as the only Linux geek in the IT department, got tasked with the project of setting one of them up as a test bed. If it works out we already have a system in place that can handle the distribution of the OS (we use it for Windows, but it's compatible with basically any OS).
So here's the problem. In Windows we give our users an "H drive". It's basically a network share mapped to the H: network drive. I would like to automatically mount that network share to /home/*username*/H. I know that I need Samba for this and that I will have to authenticate against the Active Directory domain. Those I think I have worked out already, but I've not a clue where to start to automatically mount a network share based on username like that. Can someone point me in the right direction?
Samba is used in the other direction, sharing a Linux directory with Windows systems. Mounting a Windows share on a Linux system is much simpler and is generally built into the system (see CIFS).
Is this H drive unique to each user, or is it one global drive that everybody shares? In the former case you can create an auth file for each user, something like the following:
Code:
$ cat $HOME/hdrive_auth
username = user
password = pass
Then you could mount the drive using cifs with the credentials argument.
If it's one global shared drive, then you could stick it in /etc/fstab with a standard set of credentials, and then symlink to it from everybody's home directory.
al alternative to using fstab, that can hang, is to use autofs this allows for a safer way to disconnect/reconnect without possibly hanging either the server or the workstation.
but yes very simple, configure autofs to mount the cifs to what ever you want to call it in the users /home/user/H if you wish.
Samba is used in the other direction, sharing a Linux directory with Windows systems. Mounting a Windows share on a Linux system is much simpler and is generally built into the system (see CIFS).
Is this H drive unique to each user, or is it one global drive that everybody shares? In the former case you can create an auth file for each user, something like the following:
Usually I'm going the other direction. I just assumed you needed Samba to go either way, but it's good to know about CIFS. I'll look it up.
As for the H drive, not only is it unique for each user but the shares aren't even all on the same server. Once I get the users authenticating against Active Directory I'm hoping to be able to pull their groups or their DN somehow to tell what server their share lives on. The exact path is \\*server*\*username*$. There are 6 servers that they could live on, and which server its on is determined by which of our 20 some odd sites is the users home base. It's all very neatly organized in our AD.
That auth file may be the way to go except that I don't have (or want!) the passwords for everyone who might be using these laptops. Is there a way for the system to access that information during login?
That auth file may be the way to go except that I don't have (or want!) the passwords for everyone who might be using these laptops. Is there a way for the system to access that information during login?
It's not the Linux username and password that is needed, it's the username and password on the Windows share that's needed. These [probably] won't be the same (or at least you shouldn't assume that they are the same). You could write a simple script to prompt the user for their Windows username and password to set up the H drive either the first time they log into the Linux machine, or every time they log into the Linux machine, depending on how you want to do it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.