simonhayes Posted March 3, 2015 Posted March 3, 2015 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.
themightymrp Posted March 3, 2015 Posted March 3, 2015 On the page you've linked to above it shows connecting to a home drive in section 5. For more details on the options/variables you can use on the line see this page from the documentation: Set the Home Directory and Shell for Domain Users
simonhayes Posted March 3, 2015 Author Posted March 3, 2015 On the page you've linked to above it shows connecting to a home drive in section 5. For more details on the options/variables you can use on the line see this page from the documentation: Set the Home Directory and Shell for Domain Users In that case it doesn't appear to work. I'll have a look at that link though, thanks for your help.
themightymrp Posted March 3, 2015 Posted March 3, 2015 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?
simonhayes Posted March 3, 2015 Author Posted March 3, 2015 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.
simonhayes Posted March 3, 2015 Author Posted March 3, 2015 (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 March 3, 2015 by simonhayes
Geoff Posted March 3, 2015 Posted March 3, 2015 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).
simonhayes Posted March 4, 2015 Author Posted March 4, 2015 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?
Geoff Posted March 4, 2015 Posted March 4, 2015 Yes I have this working completely. I will have to document it anyway, so I'll redact and share once that's complete. 1
simonhayes Posted March 4, 2015 Author Posted March 4, 2015 That's awesome! Thank you so much! Keep us posted.
simonhayes Posted April 15, 2015 Author Posted April 15, 2015 mount -t CIFS Thanks for your input, but that doesn't solve the problem highlighted in the OP. Geoff did you get anywhere with the write-up?
cpjitservices Posted April 15, 2015 Posted April 15, 2015 (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 April 15, 2015 by cpjitservices
Geoff Posted April 15, 2015 Posted April 15, 2015 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.
simonhayes Posted April 24, 2015 Author Posted April 24, 2015 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?
Miscbrah Posted June 11, 2015 Posted June 11, 2015 I'm interested now too. @Geoff do you have a guide yet pretty please? Ur a lovely man I've always said so...
simonhayes Posted June 29, 2015 Author Posted June 29, 2015 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.
Geoff Posted June 29, 2015 Posted June 29, 2015 The mount is probably failing. Login as root then do 'su ' and see what the error is.
simonhayes Posted June 29, 2015 Author Posted June 29, 2015 Doesn't seem to throw an error? Unless I need to check a log or something?
Geoff Posted June 30, 2015 Posted June 30, 2015 (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 June 30, 2015 by Geoff
simonhayes Posted June 30, 2015 Author Posted June 30, 2015 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now