Daily Archives: 2005-03-22

喔啦喔啦喔啦一次生一卡車帳號的 userneu

  1. 先用 ports 裝 userneu-devel。(/usr/ports/sysutils/userneu-devel/)
  2. 再從 /usr/local/share/examples/userneu/userneu.conf.example 拷貝到 /etc 下後略作修改。
  3. 用試算表生出一張要讓 userneu 去產生的帳號列表
  4. 跑 userneu,真的快好厲害。

[hhyo@samba] -~- cat /etc/userneu.conf
# The file to read user information from 此檔案請愛用試算表去生,格式見後
$userlist = "userlist2.txt";

# The login group for the users to be created 這些帳號的所屬群組
$group = "reader";

# The base directory for $home
# $homebase = "/home/$group";

# The output file containing the information of the completed user
# accounts 生出來的帳號與密碼列表
$outfile = "useraccounts";

# The password type, valid settings are "letters" (random lower case
# letters) or "chars" (misc case letters, numbers, special characters).
$passtype = "letters";

# The descriptors for the various fields in the input file, semicolon
# separated. 前面 $userlist 的格式
$descriptor = "username;real name;class";

# The delimiter for the fields of the input file. Specify as Perl
# regular expression. 所以 $userlist 存成純文字檔時請指定 Tab 分隔
$delimiter = ‘/t/’;

# Enable or disable paranoid password settings (unusual capitalisation,
# numbers, special characters, length of 10 characters). Many users are
# most likely not capable of remembering these so be careful about
# setting this to 1.
$paranoid_pass = 0;

# Specify the minimum and maximum length of the passwords generated
# $pass_minlength = 8;
# $pass_maxlength = 8;

# If you are lucky there are no windows machines in your network and you
# can leave this disabled. Otherwise set it to 1 and the script will
# generate samba accounts in addition to unix accounts so your users can
# log in on their windows machines as well.
# 如果你想一起生出 Samba 帳號請設 1
$generate_samba = 1;

# Sets the location of smbpasswd(8)
$smbpasswd = "/usr/local/bin/smbpasswd";

# Add the school year to the GECOS field in /etc/passwd. Disabled by
# default. Refer to README for a more verbose explanation
# $schoolyear_add = 0;

# Enable the "dupe engine". If this is set to 1 the script will append
# random characters to the username until it fits if it stumbles upon an
# already existing username.
# $dupe_engine_enable = 0;

# Set the location of the error log for duplicate users. Only relevant
# if the "dupe engine" is disabled.
# $errlog = "duplicate_users";

# Specify the member groups for the user accounts to be created (comma
# separated).
# $member_groups = "";

# Create a shell script for systems that come without a perl
# distribution

# $create_shellscript = 0;

# Specify the location of the shell script (implies create_shellscript)
# $shellscript_output = "createusers.sh";

# Specify the target system for the shellscript (implies
# create_shellscript)
# $target_system = $Config{osname};
[hhyo@samba] -~-