[rt-users] How to create users with CLI without being prompted for password

Todd Chapman todd at chaka.net
Wed May 10 16:41:01 EDT 2006


I think the rt command looks for the environment variables
RTUSER and RTPASSWD for authentication to the RT server.

Yes:

    Environment variables:

        The following environment variables override any corresponding
        values defined in configuration files:

        - RTUSER
        - RTPASSWD
        - RTSERVER
        - RTDEBUG       Numeric debug level. (Set to 3 for full logs.)
        - RTCONFIG      Specifies a name other than ".rtrc" for the
                        configuration file. 
        - RTQUERY       Default RT Query for rt list 
        - RTORDERBY     Default order for rt list


-Todd

On Wed, May 10, 2006 at 04:22:44PM -0400, Tomasz Wlodek wrote:
> 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                  |
> 
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
> 
> 
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
> Buy a copy at http://rtbook.bestpractical.com
> 
> 
> We're hiring! Come hack Perl for Best Practical: http://bestpractical.com/about/jobs.html



More information about the rt-users mailing list