LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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-14-2014, 01:54 PM   #1
sisk
LQ Newbie
 
Registered: Sep 2006
Posts: 24

Rep: Reputation: 0
Windows shares as home?


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?
 
Old 02-14-2014, 02:21 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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.
 
Old 02-14-2014, 02:21 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
double post

Last edited by suicidaleggroll; 02-14-2014 at 02:23 PM.
 
Old 02-14-2014, 02:54 PM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
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.
 
Old 02-14-2014, 04:05 PM   #5
sisk
LQ Newbie
 
Registered: Sep 2006
Posts: 24

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by suicidaleggroll View Post
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?
 
Old 02-14-2014, 04:18 PM   #6
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by sisk View Post
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.
 
  


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
Samba home shares tqz Linux - Server 4 01-17-2010 03:18 AM
Brand Newbie can't connect to his Windows shares at home turnermike53 Linux - Newbie 8 11-22-2008 09:32 AM
win xp home edition and samba home shares scheidel21 Linux - Software 8 10-09-2008 12:47 AM
shares not in home folder rmdnet Linux - Networking 8 11-28-2004 01:02 PM
Linux can mount samba shares but not windows shares bindsocket Linux - Software 1 12-01-2003 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:50 PM.

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