Hi,
Try setting the --generatekey option of setup-ssh to true:
asadmin setup-ssh --sshuser testuser --generatekey=true
testserver.domain
If --generatekey is true, setup-ssh creates the key pair without prompting.
Note that to distribute the public key, authentication of the SSH user's
login is required. For information about how to distribute the public
key without being prompted, see the setup-ssh
<
http://download.oracle.com/docs/cd/E18930_01/html/821-2433/setup-ssh-1.html#scrolltoc>
manual page. You can also view the content of the setup-ssh manual page
in a terminal window by typing:
asadmin help setup-ssh
Hope this helps.
--
Paul Davies| Principal Technical Writer|
Oracle GlassFish Server Documentation
On 10/4/2011 3:32 PM, forums_at_java.net wrote:
> I am trying to create a script to non-interactively call 'asadmin
> setup-ssh
> ' command. But it is not working how I am expecting.
>
> Following is the interaction, when I run the command from command line.
>
> */[user_at_server bin]$ asadmin setup-ssh --sshuser testuser
> testserver.domain
> SSH key not found for user testuser
> Would you like to generate a SSH key pair (without a key passphrase) for
> testuser to access [testserver.domain]? [y/n]:/*
>
> But if I pass the input 'y' through a redirected input text file, it
> fails..
>
> /*[user_at_server bin]$ asadmin setup-ssh --sshuser testuser
> testserver.domain < accept.txt
> SSH key setup failed: SSH key pair not present. Please generate a key
> pair
> manually or specify an existing one and re-run the command.
> Command setup-ssh failed.*/
>
> I tried it through ant-script but that does not work either..
>
> */<exec executable="./asadmin" dir="glassfish_install_dir/bin"
> input="accept.txt">
> <arg line="setup-ssh"/>
> <arg line="--sshuser testuser"/>
> <arg line="testserver.domain"/>
> </exec>/*
>
> Any suggestions ?
>
> Thanks
>
> Vineet
>
>
>
>
> --
>
> [Message sent by forum member 'vmiharia']
>
> View Post: http://forums.java.net/node/850202
>
>