The AM remote agent installs and uses Plink (PuTTY Link) as an SSH client to communicate with most types of remote hosts. However, the first time that Plink connects as a given user to a new target it displays the host key and, as a security measure, interactively asks if the host is legitimate. Obviously, the AM remote agent does not support such interactivity with a user, so you must first reassure Plink before gathering inventory. Show Since Plink saves the remote host’s key in the registry, you can generate such a registry entry for a convenient log in user and then save the same key under the LocalSystem account that the asset management agent runs as. To generate a registry entry and save the host key under the LocalSystem account
Plink must be configured for each remote host for which the AM remote agent gathers inventory; so connect to all remote hosts in order to generate host keys, and then run the above export-import procedure once. If you suspect that Plink may not be configured correctly for the LocalSystem account, run the asset management agent (“caf start amagent”), wait for all AM processes to finish, and then examine the trace file, TRC_UAM_amvminvux_*.log. Search for “The server's host key is not cached in the registry.” If you find such an error, Plink is not correctly configured. Also, if you see the "Access denied" error in the trace file, this usually means a problem with the credentials used to access the remote host, for example, an incorrect password or SSH key. For detailed information about Plink, refer to the PuTTY/Plink manual on the following website: http://www.chiark.greenend.org.uk/~sgtatham/putty/docs.html Plink (PuTTY Link) is a command-line connection tool similar to UNIX 4. It is mostly used for automated operations, such as making CVS access a repository on a remote server.Plink is probably not what you want if you want to run an interactive session in a console window. 7.1 Starting PlinkPlink is a command line application. This means that you cannot just double-click on its icon to run it and instead you have to bring up a console window. In Windows 95, 98, and ME, this is called an �MS-DOS Prompt�, and in Windows NT and 2000 it is called a �Command Prompt�. It should be available from the Programs section of your Start Menu. In order to use Plink, the file 5 will need either to be on your 6 or in your current directory. To add the directory containing Plink to your 6 environment variable, type into the console window:
This will only work for the lifetime of that particular console window. To set your 6 more permanently on Windows NT, use the Environment tab of the System Control Panel. On Windows 95, 98, and ME, you will need to edit your 9 to include a 0 command like the one above.7.2 Using PlinkThis section describes the basics of how to use Plink for interactive logins and for automated processes. Once you've got a console window to type into, you can just type 1 on its own to bring up a usage message. This tells you the version of Plink you're using, and gives you a brief summary of how to use Plink:
Once this works, you are ready to use Plink. 7.2.1 Using Plink for interactive loginsTo make a simple interactive connection to a remote server, just type 1 and then the host name:
You should then be able to log in as normal and run a session. The output sent by the server will be written straight to your command prompt window, which will most likely not interpret terminal control codes in the way the server expects it to. So if you run any full-screen applications, for example, you can expect to see strange characters appearing in your window. Interactive connections like this are not the main point of Plink. In order to connect with a different protocol, you can give the command line options 3, 4, 5 or 6. To make an SSH connection, for example:
If you have already set up a PuTTY saved session, then instead of supplying a host name, you can give the saved session name. This allows you to use public-key authentication, specify a user name, and use most of the other features of PuTTY:
7.2.2 Using Plink for automated connectionsMore typically Plink is used with the SSH protocol, to enable you to talk directly to a program running on the server. To do this you have to ensure Plink is using the SSH protocol. You can do this in several ways:
Usually Plink is not invoked directly by a user, but run automatically by another process. Therefore you typically do not want Plink to prompt you for a user name or a password. Next, you are likely to need to avoid the various interactive prompts Plink can produce. You might be prompted to verify the host key of the server you're connecting to, to enter a user name, or to enter a password. To avoid being prompted for the server host key when using Plink for an automated connection, you should first make a manual connection (using either of PuTTY or Plink) to the same server, verify the host key (see section 2.2 for more information), and select Yes to add the host key to the Registry. After that, Plink commands connecting to that server should not give a host key prompt unless the host key changes. To avoid being prompted for a user name, you can:
To avoid being prompted for a password, you should almost certainly set up public-key authentication. (See chapter 8 for a general introduction to public-key authentication.) Again, you can do this in two ways:
Once you have done all this, you should be able to run a remote command on the SSH server machine and have it execute automatically with no prompting:
Or, if you have set up a saved session with all the connection details:
Then you can set up other programs to run this Plink command and talk to it as if it were a process on the server machine. 7.2.3 Plink command line optionsPlink accepts all the general command line options supported by the PuTTY tools. See section 3.7.3 for a description of these options. Plink also supports some of its own options. The following sections describe Plink's specific command-line options. 7.2.3.1 Z:\sysosd>plink -ssh login.example.com
login as:
|