In my environment I constantly have to attach an NFS server running on Linux. The Linux client system has user names created in it and they are in a sequential order. But in order to set the sharing permission for each user individually, I have to create them using
useradd -u 2001 -g 1000 -d /home/app/mnt/1 user1 in my NFS server. If my client system has 1000 users I have to individually crate them on my NFS server too.
I want to create multiple user names and assign an UID (not random) using shell script in my Linux NFS server. I also want to assign them a home directory automatically. For example I want to create users like
| Username| UID |Home Directory| | user1 |20001|/home/users/1 | | user2 |20002|/home/users/2 | | user3 |20003|/home/users/3 | | . | . | . | | . | . | . | | . | . | . | | userX |2000X|/home/users/X |
User name always starts with "user", it remains the same. X could be 100 to 1000.
These users are necessary but short lived hence I don't want to go for a central user management platform. Is it possible that a shell script can create users in bulk?
I went through this article. This starts with exactly what I want, but later goes into things which makes no sense to me.