Hello list,

I wanted to share a simple way I use to create users for testing, it is 
something that I get regularly asked when we do testing so I thought it may 
turn useful to others.

Assume we have a FreeIPA domain called freeipa.org and we want to create a few 
test users with a specific password,
here is a simple script that does it (requires you kinit as admin first):

---------------------------------------------------------------------------------
#!/bin/bash

# Pass user name as first argument and password as second argument

ipa user-add $1 --first Test --last User
echo "test" | ipa passwd $1 
ldappasswd -D uid=$1,cn=users,cn=accounts,dc=example,dc=org -w test -a test -s 
$2
---------------------------------------------------------------------------------


In this example no escaping is performed, so you'll need to add it to user 
names/password if you want to use characters that may cause shell expansion.

Hope this helps.

Simo.

-- 
Simo Sorce * Red Hat, Inc. * New York

_______________________________________________
Freeipa-users mailing list
Freeipa-users@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-users

Reply via email to