Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: Linux::usermod - user name ... already existsby thanos1983 (Parson) |
on Mar 19, 2019 at 21:14 UTC ( [id://1231453]=note: print w/replies, xml ) | Need Help?? |
Hello again mldvx4, I was thinking exactly like this. That your script will do something like that. Well an alternative solution would be to remove the user Linux::usermod->del(username); (I assume the module removes the user from all groups) and after that create a new user Linux::usermod->add(username, password, uid, gid, comment, home, shell); with the updated name. That could be a workaround (assuming there are no errors on this one as well). Not to forget you can assign the user to the desired groups . But again this is just theory I have not tested it so I do not know if there is a bug in all these commands. Let us know at the end what solution you came up with. BR / Thanos
Seeking for Perl wisdom...on the process of learning...not there...yet!
In Section
Seekers of Perl Wisdom
|
|