unix:linux:sysadmin:syncusers
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| unix:linux:sysadmin:syncusers [2022/01/17 18:08] – created rodolico | unix:linux:sysadmin:syncusers [2022/01/17 18:40] (current) – rodolico | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| The two variables at the top of the page, // | The two variables at the top of the page, // | ||
| - | It does **not** set the UID or GID, except that all users are members of the group users. | + | It does **not** set the UID, and sets primary group to //users//. All users are members of the group sudo, which gives them sudo rights. See line in middle of sub addAUser to modify that. |
| - | Use with caution, but it has worked well for us in the past. | + | The passwords are encrypted using the command <code bash> |
| + | |||
| + | Use with caution, but it has worked well for us in the past. It is not well documented. | ||
| <code perl fixusers.pl> | <code perl fixusers.pl> | ||
| Line 26: | Line 28: | ||
| # we use this to know to change usernames, in other words, if | # we use this to know to change usernames, in other words, if | ||
| - | # the username | + | # the username |
| - | # to breena. | + | # to user1, while baduser is removed if it exists. |
| # if the $changeTo is empty, we simply remove the user. | # if the $changeTo is empty, we simply remove the user. | ||
| my %fixUserNames = ( | my %fixUserNames = ( | ||
| Line 35: | Line 37: | ||
| ); | ); | ||
| - | # ' | + | # ' |
| + | # echo ' | ||
| # 'ssh key' is the value found in ~/ | # 'ssh key' is the value found in ~/ | ||
| + | # in the following example, ' | ||
| + | # and their password is changed to ' | ||
| + | # nothing is done to their ssh key. | ||
| + | # user2 is treated the same way, but their ssh public key is added to their authorized_keys file | ||
| my %passwords = ( | my %passwords = ( | ||
| ' | ' | ||
| - | ' | + | ' |
| 'ssh key' | 'ssh key' | ||
| }, | }, | ||
unix/linux/sysadmin/syncusers.1642464486.txt.gz · Last modified: 2022/01/17 18:08 by rodolico
