SYSTEM INFORMATION | |
---|---|
OS type and version | EL8 |
Webmin version | 2.303 |
Asked but perhaps missed back in December 22.
Can the Export to batch file function be configurable, namely to include of use blank UID and GID?
SYSTEM INFORMATION | |
---|---|
OS type and version | EL8 |
Webmin version | 2.303 |
Asked but perhaps missed back in December 22.
Can the Export to batch file function be configurable, namely to include of use blank UID and GID?
Still ignored?
Nobody is ignoring you, I just don’t have a simple answer.
If I needed to do this, I’d probably just post-process the file with sed
or perl
or python
to change it in whatever way you want to change it.
But, I’m not sure Webmin can be made to do the thing you’re wanting/expecting when re-importing just by blanking the GID. I think Webmin is expecting the file to be in the format specified and isn’t going to infer you want a new group created based on a blank field. Webmin is kind of old-fashioned and doesn’t really create users the way useradd
does it on modern Linux distributions. Blanking it will just leave it alone…but, I don’t see how that can result in the behavior you want (you need it to create a group with the same name).
It’d be great if Webmin allowed custom UID/GID settings for better compatibility when migrating. Hopefully, they consider making the export format user-configurable soon.
" In create lines, if the uid field is left empty, Webmin will assign a UID automatically. If the gid field is empty, Webmin will create a new group with the same name as the user. The username, homedir and shell fields must be supplied for every user - all other fields are allowed to be empty. If the passwd field is blank, no password will be assigned for the user. If it contains just the letter x, the account will be locked. Otherwise, the text in the field will be taken as the cleartext password and encrypted."
This worked for me:
awk -F: ‘BEGIN{OFS=“:”}{$4=“”;$5=“”;print}’ input.txt > output.txt
Oh! I guess Webmin got smarter in the years since I last messed around with that feature. That’s great!
You have some excellent people there.
This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.