The constructor called when creating an object. A constructor does not return a value. If an error occurs, it raises an exception.
The constructor has the following syntax:
RemoteTarget(host [,user] [,pass] [,key] [,phrase] [, port])
Specifies the name of the remote host.
(Optional) Specifies the user name to use to log in to the remote node. A user name is required for password or public key authentication. If no user name is specified, the user name entered during AutoShell login is used.
Default: $$User
(Optional) Specifies password to use to log in to the remote host. If no password is specified, the password entered during AutoShell login is used.
Default: $$Pass
(Optional) Specifies an absolute or relative path to a file containing a private RSA key to use to log in to the remote host. If a private key and a password are specified, AutoShell attempts a public key logon first, and if that fails, a password logon.
Default: ""
(Optional) Specifies the passphrase for a private key. If the key is not encrypted, the passphrase is not required.
Default: ""
(Optional) Specifies the port on which to connect to the remote host.
Default: SSH standard port 22.
Examples
Create a RemoteTarget object using password authentication:
rt = new RemoteTarget("ascli1", "bob", "ca123456");
Create a RemoteTarget object attempting public key authentication followed by password if public key authentication fails:
rt = new RemoteTarget("ascli1", "bob", "ca123456", "bob_rsa.key");
In this case the file bob_rsa.key contains the private RSA key.
Copyright © 2013 CA. All rights reserved. |
|