Per the man page for adduser:
-f file
Get the list of accounts to create from file. If file is “-”,
then get the list from standard input. If this option is
specified, adduser will operate in batch mode and will not seek
any user input. If an error is encountered while processing an
account, it will write a message to standard error and move to
the next account. The format of the input file is described
below.
So I read the formatting carefully, I created a plain text file, with the following contents (one line only as a test, I need to add 30 users)
I save that text file as TestAccountCreate.txt, I cd to the directory it's in, and I run:
I get no error.
But I run:
And there's no "testuser"
I also checked the FreeNAS Web GUI and tried to change the password via
And the account just doesn't exist.
I was sure it was something about syntax or an invalid argument... I googled up this page:
https://wiki.pacbsd.org/index.php/Users_and_groups
Which provides an example. It seems to me that I'm consistent, but just to be sure, I changed the contents of text file to exactly their example:
Saved it, ran again, and again, there is no jsmith user on the system.
Any ideas?
I mean, other than adding 30 users one by one though the GUI or interactive adduser?
Thanks,
Tom.
-f file
Get the list of accounts to create from file. If file is “-”,
then get the list from standard input. If this option is
specified, adduser will operate in batch mode and will not seek
any user input. If an error is encountered while processing an
account, it will write a message to standard error and move to
the next account. The format of the input file is described
below.
So I read the formatting carefully, I created a plain text file, with the following contents (one line only as a test, I need to add 30 users)
Code:
testuser::1006::::Mr Test:/nonexistent:csh:SomePassword
I save that text file as TestAccountCreate.txt, I cd to the directory it's in, and I run:
Code:
adduser -f TestAccountCreate.txt
I get no error.
But I run:
Code:
awk -F":" '{print $1}' /etc/passwd
And there's no "testuser"
I also checked the FreeNAS Web GUI and tried to change the password via
Code:
passwd -l testuser
And the account just doesn't exist.
I was sure it was something about syntax or an invalid argument... I googled up this page:
https://wiki.pacbsd.org/index.php/Users_and_groups
Which provides an example. It seems to me that I'm consistent, but just to be sure, I changed the contents of text file to exactly their example:
Code:
jsmith:::wheel:::John Smith:/home/jsmith:bash:CorrectHorseBatteryStaple
Saved it, ran
Code:
adduser -f TestAccountCreate.txt
Any ideas?
I mean, other than adding 30 users one by one though the GUI or interactive adduser?
Thanks,
Tom.