I have a single computer for our building which various building residents need to be able to log into with their own names. I have a listing of all the usernames (over 300 users) and passwords in a text file. I did some research and found that it should be possible to add them using a script, but there were so many changes whenever a possible script was posted that I had trouble following the message threads to get a coherent final script to use.
So far, here is what I have found, and I hope this works in Suse 11.3:
But it doesn't say anything about adding to more than one group? I know if I add thru YAST, it adds to users, and then by default adds to the additional group "video" (is this for them to be able to log in with the gui?)
However, the script I found shows one user group, but didn't say what to do if I needed to add to more than one group? Or will adding these users via the list auto-add them to video because of the default in YAST? Or do I need to put both groups, maybe comma-separated or something?
I am a mostly newbie here, and I really don't do code, but I can follow directions if they're explained well enough!
Here's what I found:
Use chmod command:
# touch /root/batch-user-add.txt
# chmod 0600 /root/batch-user-add.txt
Create a user list as follows. Open file:
Append username and password following the format provided of:
# vi /root/batch-user-add.txt
*** does this mean simply copy/paste the below user info into the batch-user-add.txt file?
also, what happens if you don't define shell? and which shell is better?
Now create users in batch:
Ok, this seems fairly straightforward so far, and the command line doesn't intimidate me too much, as I grew up on DOS.
# newusers /root/batch-user-add.txt
Can someone tell me if I'm doing this right? And if I need to worry about whether it's only adding to the group "users" and not to "video" ? Or how to add to both?
and final question, a quick way to set all those newly created users to require them to change their password on first login, and then to never have the password expire afterwards? (hopefully without resetting my root password in the process?)
Any help on this is greatly appreciated! Thanks!