shell_tips:adding_multiple_users
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
shell_tips:adding_multiple_users [2012/08/14 12:36] – ikahugu | shell_tips:adding_multiple_users [2012/08/14 12:43] – ikahugu | ||
---|---|---|---|
Line 23: | Line 23: | ||
5. With random passwords | 5. With random passwords | ||
< | < | ||
- | $for usernum in {1..50}; do useradd -m user$usernum; | + | $for usernum in {1..50}; do useradd -m user$usernum; |
+ | echo `</ | ||
+ | gpasswd -a " | ||
+ | /bin/cp -f / | ||
</ | </ | ||
**Note**: We have used /bin/cp to escape cp alias in bash; this is usually on Centos | **Note**: We have used /bin/cp to escape cp alias in bash; this is usually on Centos | ||
+ | |||
+ | **Delete users** | ||
+ | Remove the above users; including mailboxes and home folders | ||
+ | |||
+ | < | ||
+ | for usernum in {1..50}; do userdel -r -f user$usernum; | ||
+ | </ |
shell_tips/adding_multiple_users.txt · Last modified: 2012/08/14 12:43 by ikahugu