How do you change the Linux user and group id of a virtual domain?
I’ve tried to manually change it by first do usermod/groupmod, then changing the original user/group id among some files under /etc/webmin/, but I still get errors when I do Validate Virtual Servers:
Administration user : Administration user xyz has UID 601, but the domain’s UID is 506
Home directory : Home directory /home/xyz is owned by xyz instead of xyz
and in several other Virtualmin settings where it shows the Linux name of UID 506 instead of UID 601.
Yeah, I’m not sure it was ever designed for the UID and GID of Virtual Server’s to be easily changed But I’m sure you can do it. Here’s some thoughts:
In /etc/webmin/virtual-server/domains/, are all the domains on the server. In each are a uid, gid, and ugid field. You’ll need to change the files relating to Virtual Servers owned by this particular user.
You’ll need to update map.gid in /etc/webmin/virtual-servers/
You’ll need to update /etc/webmin/file/USERNAME.acl
And also /etc/webmin/proc/USERNAME.acl
And of course, you’ll need to update the permissions on the user’s home directory as well
That’s what I found by doing a quick search in the /etc/webmin directory – there could be other things I missed, but that seems to be the bulk of it
I had changed ownerships and some of the files you mentioned, but missed those under /etc/webmin/virtual-servers/. And I don’t have a map.gid there, only files with some unique number for each domain. Changing those seems to have solved most of the problems I’ve had!
I still have some minor problems, but I hope to be able to solve them.
Btw, I think it is sort of a drawback that you can’t assign a virtual domain to an already existing UID/GID. The original problem is that I’m trying to match the UID/GID of the domains from a mounted NFS file system.
Glad to hear it’s coming along!
You have a valid point about NFS… you’re welcome to file a ticket in the Bugs and Issues section and plead your case there… if Jamie doesn’t already have a way to handle that, he may consider adding one.
Of course I had a map.gid file, and I needed to change everything just as you wrote. I was too quick and missed some files.
I might add a request for this into Bugs and Issues. At least one could add the "procedure" you wrote to the FAQ.
Thanks for the quick help!