Jump to content

Recommended Posts

Posted

Hi guys,

 

I've googled this time and time again but cannot find a suitable answer anywhere.

 

I have finally managed to get an Ubuntu PC (Lubuntu actually) to allow Windows users to logon after hours of faffing around! (Thanks to these instructions just in case anyone else is interested.)

 

Now I would like to have it set up so that a Windows user automatically gets their home share mounted when they logon. (And preferably some other Windows shares depending on user but I don't want to run before I can walk!)

 

I have a user lets say 'harrypotter'. When he logs on to a Windows computer the N:\ drive automatically maps to \\server\harrypotter$

 

How can I reproduce something like this on Ubuntu?

 

Thanks in advance.

Posted
To be fair I've never tried it myself. I don't have any domain joined Linux machines, but I've read some bits n bobs on it before. If you manage to get it working can you post the solution?
Posted

I've tried this:

 

HomeDirPrefix "smb://server/"
HomeDirTemplate %U$

 

But it fails to logon then.

 

I'm guessing I might have to mount the //server/Users share at boot to a specific mount point then it might work. The only trouble is our staff are on a different server so they will nee a different configuration entirely.

Posted (edited)

One of my problems with this is that my students are all in different sub folders on the server depending on what year they are in. Harry Potter is a year 7 user, so I just tried mounting the //server/Users/Year 7 folder to /home/Students/ at bootup using these instructions, which worked fine. Then I tried setting HomeDirTemplate to /home/Students/%U. It tried to log on, but logged straight back off again.

 

Can anyone shed some light on this?

 

To be fair, I'm not really fussed if the user has the SMB share as the home folder or not, as long as they can connect to it. Can it be mapped by a login script or somrhing?

Edited by simonhayes
Posted
Note that I specifically didn't want to use Samba. Therefore I'm using sssd to allow PAM logins with AD credentials via LDAP/Kerberos. I have the UNIX schema extensions installed on my DCs. My Windows File server is exporting the Users share via NFS. My linux machines mount this NFS share under /home/domain/ and users UnixHome are set in AD to point to this (Powershell is helpful here to automate this). This allows for full Single Sign On via SSH (leys are stored in AD, Putty Pagent is used for key based passwordless auth) with users home dirs mounted in Linux as ~ (which is what I care about).
Posted
Note that I specifically didn't want to use Samba. Therefore I'm using sssd to allow PAM logins with AD credentials via LDAP/Kerberos. I have the UNIX schema extensions installed on my DCs. My Windows File server is exporting the Users share via NFS. My linux machines mount this NFS share under /home/domain/ and users UnixHome are set in AD to point to this (Powershell is helpful here to automate this). This allows for full Single Sign On via SSH (leys are stored in AD, Putty Pagent is used for key based passwordless auth) with users home dirs mounted in Linux as ~ (which is what I care about).

So you have this working completely Geoff?

 

I don't suppose you'd be kind enough to write a more detailed tutorial?

Posted
Yes I have this working completely. I will have to document it anyway, so I'll redact and share once that's complete.
  • Thanks 1
  • 4 weeks later...
  • 2 weeks later...
Posted (edited)

I did do this for a college once in their Programming lab, if you logged in you'd have your home drive mounted to the desktop, like a roaming profile for windows you could go to any Linux machine login and have your home drive. However, this was a differnet system to the Windows network roaming profile, it was a separate thing entirely.

 

The way it worked was there was A central CentOS server which hosted Samba shares, these would be used as home directories for logged on users. Bash Script would start wen the user logged in. Mounted the home drives. Home drives / folders wouldn't be attached to a username as there was usually a change of groups every 3 - 6 months or so, you'd log in as UserA and you could log onto any Linux PC (Fedora Usually) and get the home drive for User A. And So on. We had a periodic script that ran with Cron that would clean out the home drives after the user had left.

 

Its been a long time since I did this. A very long time. The server was based on CentOS 5.4 and PC's where Fedora 6 - I believe they ran as thin clients from LTSP so nothing was actually on the PC's.

 

You may want to join the Ubuntu machines to the Windows Domain if you havent already done so, there's a nice GUI program for it too. The program is called Likewise-Open - although I think its been renamed but if you search Google then you can find it. Once joined you just need to script it so that when a user logs in it mounts drives etc.

 

Is this a similar thing to what you want to achieve ?

 

http://www.powerbrokeropen.org/

Edited by cpjitservices
Posted
Thanks for your input, but that doesn't solve the problem highlighted in the OP.

 

Geoff did you get anywhere with the write-up?

 

I have a rough guide.

  • 2 weeks later...
Posted

You may want to join the Ubuntu machines to the Windows Domain if you havent already done so, there's a nice GUI program for it too. The program is called Likewise-Open - although I think its been renamed but if you search Google then you can find it. Once joined you just need to script it so that when a user logs in it mounts drives etc.

 

Is this a similar thing to what you want to achieve ?

 

PowerBroker Open - Likewise Open - Active Directory Software Integration

I've done that already, but would like Ubuntu to map their Windows share when the user logs in.

 

Geoff, any chance you could post your rough guide here?

  • 1 month later...
  • 3 weeks later...
Posted
It works up to the point where you connect users home directories. Which I can't get to work. It creates the profile folder locally but doesn't write anything back to the server.
Posted (edited)

Same as every log on Linux: /var/logs

 

Also check the syslog while you are there, it'll be called 'messages' or 'syslog.log'.

Edited by Geoff
Posted

There's not an audit.log, but an auth.log. Not really sure what I'm looking for, but here is what happened in that when I did a 'su domainuser' command:

 

auth.log

Jun 30 12:37:37 simon-rm-nbook-200 su[1885]: (pam_mount.c:365): pam_mount 2.14: entering auth stage
Jun 30 12:37:37 simon-rm-nbook-200 su[1885]: Change user from '[email protected]' to 'systemadmin' as requested by PAM
Jun 30 12:37:37 simon-rm-nbook-200 su[1885]: Successful su for systemadmin by simon
Jun 30 12:37:37 simon-rm-nbook-200 su[1885]: + /dev/pts/1 simon:systemadmin
Jun 30 12:37:37 simon-rm-nbook-200 su[1885]: pam_unix(su:session): session opened for user systemadmin by simon(uid=1000)
Jun 30 12:38:16 simon-rm-nbook-200 sudo: (pam_mount.c:365): pam_mount 2.14: entering auth stage

 

There doesn't appear to be anything particularly relevant in the syslog file.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...