admin@glassfish.java.net

Re: How can console pass a password or password alias to a command

From: Joe Di Pol <joe.dipol_at_oracle.com>
Date: Tue, 16 Nov 2010 11:40:06 -0800

Anissa Lam wrote:
>
> What Ludo explained below is what i use to provide the "password alias"
> feature in the console. This new console feature is in today's nightly
> build.
> If you go to
> http://localhost:4848/management/domain/create-password-alias , you see
> that the parameter name is "AS_ADMIN_ALIASPASSWORD", so, I just pass
> in "aliaspassword" as the key name for the password field when
> creating the payload for this command.
>
> I guess you can define the the parameter as "AS_ADMING_SSHPASSWORD",
> and GUI can pass the password to you the same way by specifying
> "sshpassword" as the key in the payload thats sent to REST.

I don't think I need to define a new parameter. create-node-ssh does:

     @Param(name = "sshpassword", optional = true, password = true)
     private String sshpassword;

I think this means you should be able to use AS_ADMIN_SSHPASSWORD
just like you did for create-password-alias.

>
> I don't see the --sshpassword parameter now though?

password parameters are not listed in usage messages.

>
> Usage: asadmin [asadmin-utility-options] create-node-ssh --nodehost
> <nodehost>
> [--installdir <installdir(default:${com.sun.aas.productRoot})>]
> [--nodedir <nodedir>] [--sshport <sshport(default:22)>]
> [--sshuser <sshuser(default:${user.name})>] [--sshkeyfile <sshkeyfile>]
> [--force[=<force(default:false)>]] [-?|--help[=<help(default:false)>]]
> name
>
> Anissa.