[BlueOnyx:22999] Re: Importing users from a FreeBSD server
Michael Stauber
mstauber at blueonyx.it
Sun Jul 14 23:55:04 -05 2019
Hi Ernie,
> I am trying to import a few dozen users from a FreeBSD server into a BX
> 5209R server
>
> What's the best way to go about it?
> The passwords are encrypted but look to be the same format as BX uses.
The crypted passwords are good enough for a migration.
You can use the Linux command "usermod" with the -p switch and then set
the password of an existing user to the crypted password that you have
from another box.
Example:
usermod ernie -p '$1$FYasdsad.EDWIsdi3ege1'
As for importing the users themselves to BlueOnyx? There are two ways
about it:
You can create them manually by using the GUI and then change their
passwords with "usermod" to the crypted passwords.
Or you can script it. For scripting you have several options. You can
throw together a little shell script that parses your /etc/passwd and
/etc/shadow from the source box and then simply uses
"/usr/sbin/cadduser" on the BlueOnyx to create the users:
[root at 5209r]# cadduser -help
Usage /usr/sbin/cadduser [OPTION]...
--admin, -a, --enable-admin
User is a site-admin
--adminPassword=string, --adminpw
Admin's password
--aliases=list, -e
list of email alaises, comma delmited
--forward=list, -e
foward email to email addresses, comme delimated
--fqdn=string, --domain, -d
fully quilified domain name ie. www.domain.com
--fullname=string, -f
user's full name, user name is used if not provided
--group=string, -g, --groupname
group name of the site you wish to add the user to ie. site2
--help, -h, -?
Help Text
--name=list, -n
Name of the User
--password=string, -p
user password
--quick, -Q
Quick Help Text
--quota=integer, -q, --set-quota
Set the disk quota of this user in megabytes (MB)
--remarks=string, -r
user remarks
--shell, -t, --enable-shell
Or you can create a Perl script that parses these files and uses CCE
methods to create the User objects and sets their key/value pairs to
sensible data. This is however a bit more advanced and a shell script
that uses "cadduser" is perhaps easier.
--
With best regards
Michael Stauber
More information about the Blueonyx
mailing list