users@glassfish.java.net

glassfish asadmin setup-ssh non-interactive

From: <forums_at_java.net>
Date: Tue, 4 Oct 2011 17:32:20 -0500 (CDT)

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