Jason Edgecombe <[EMAIL PROTECTED]>
>
> I have attached my perl script for reference. how can I safely update
> the /etc/passwd and /etc/shadow files?
>
> What is the best practice? I don't want to set up an LDAP server because
> of internal politics and the extra work involved.
>

I did not dig through your script to deeply, but based on your description
the route that I would take is to use the system utilities inside your
script instead of managing the file directly.

The utilities that you could use:

useradd
usermod
userdel
groupadd
groupmod
groupdel
getent

The getent utility is very helpful because it is very akin to grepping the
appropriate file, but you get less false positives on similar matches
without getting to specific on your grep.  It supports passwd, shadow,
group, and more...

Personally, I would re-work the script to utilize these methods instead as
they should be capable of handling most tasks.

-greg

_______________________________________________
rhelv5-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/rhelv5-list

Reply via email to