Sample Header Ad - 728x90

Unable to change home folder setting in Samba/Winbind

-1 votes
1 answer
2880 views
I'm using a Debian 8 server at work. Recently, I used Samba and Winbind to join it to the domain. This domain is managed by Active Directory on a Windows Server machine. This all works: domain users can SSH into the server with their AD passwords, wbinfo gives me domain groups or users, and so on. I even get domain groups when I use the "groups" command on local Debian users who also have domain accounts. Here's the problem. When I set all this up, I thought I wanted to put all newcomers to the server in /home/domain/username, so I set up my smb.conf file accordingly. Now, though, I've changed my mind thanks to an Nginx setup I won't go into here. I want users to go to /home/username instead. I've updated smb.conf, but my new setting won't take effect. The first user I've been testing all this on is me, but I'm an admin for the domain. I needed a non-admin user, so chose someone who works just down the hall. She logged in before I made the change, and, as you'd expect, was given a /home/domain/username folder. Now that I've decided not to use the domain folder for home directories, though, I want to move her home folder to /home/username. The Nginx thing makes it important that this happens. I also want this to happen for all future users who get on the server, but everyone is currently stuck in /home/domain/username instead. I've so far tried usermod, but that fails because, as a domain user, this test user is not in the local system at all, so there's no entry in /etc/passwd. I've tried username, domain\\username, domain\\\\username, and other variants. My winbind separator is indeed backslash. I knew none of this would work, since passwd has no record of this user at all, but I tried just the same. I've also tried moving the user's home folder where I want it, so her old folder is gone, then having her log in. I hoped Samba would find no home folder, see my new template telling it where to place users, and go to /home/username. Instead, it created /home/domain/username again, and put her in there. I'm having her log in over SSH. When I run getent passwd I get all the domain users and groups, but all of them show home folders of /home/domain/username instead of /home/username. Yet, in smb.conf, I have this in the [globals] section: template homedir = /home/%U I've restarted Samba several times. I've even made these changes to sssd and restarted that, although I'm not using sssd. I restarted ssh just to be sure. I now know why my test user won't move, but that only showed me that all users will have this problem. Indeed, when I had a second user log in over SSH using domain credentials, she, too, went to /home/domain/username. Nothing has worked so far. I don't know what else I should try in order to get the home folder setting how I want it. Can anyone spot anything I might have missed: a setting, something to restart, anything? I'm new to using Linux on a domain, so have cobbled my current setup together from many online articles and forums. It works, but I don't know enough about it to troubleshoot extensively. If I've missed telling you any important details, let me know.
Asked by AH16 (109 rep)
Oct 1, 2018, 10:07 PM
Last activity: Dec 31, 2018, 12:01 PM