[rt-users] How to create users with CLI without being prompted for password
Tomasz Wlodek
tomw at bnl.gov
Wed May 10 16:22:44 EDT 2006
Hi,
I am trying to create users using command line interface. I do:
./rt create -t user set username=test1 emailaddress=a at b.com password=testpwd
But then rt asks me for password:
>Password:
Question 1: Which password does it want? the root pwd for RT mysql
database? or the superuser password?
Question 2: Can I get rid of the password question? My users will be
created automatically in a script which calls "rt create ...".
I see in the rt code subroutine
read_passwd sub read_passwd {
eval 'require Term::ReadKey';
if ($@) {
die "No password specified (and Term::ReadKey not installed).\n";
}
print "Password: ";
Term::ReadKey::ReadMode('noecho');
chomp(my $passwd = Term::ReadKey::ReadLine(0));
Term::ReadKey::ReadMode('restore');
print "\n";
return $passwd;
}
What will happen if I throw away content of this routine and make it
return the mysql root password?
Is there a simpler way to bypass the password question?
Tomasz Wlodek | tel 631-344-7448
Brookhaven Laboratory, Building 510M | fax 631-344-7616
Upton NY 11973-5000 |
More information about the rt-users
mailing list