Technical Notes |
|
This note describes how you can use the Reflection Profiler to create a site default settings file that configures every newly created Reflection session to use Secure Shell as the default connection type. Also, by running the macro described in this technical note, you can migrate prior version settings files, regardless of their current connection type, to use an SSH connection.
Before you begin, review the Reflection Deployment Guide, http://www.attachmate.com/docs/reflection/14.0/deploy.pdf, for an overview of how to customize a Reflection installation and how to prepare a profiled version of Reflection for distribution to your users. For information about Reflection Secure Shell, see Technical Note 1857 (version 13.0) or Technical Note 1727 (version 10.0 12.x).
You can use a site default settings file to configure every newly created session to use a Secure Shell connection type. And, if you have prior version settings files that don't use a Secure Shell connection type, you can create a migration macro that will change the connection type to Secure Shell.
In a site default settings file, you can define the default values for settings such as host connection, default toolbar, display, and keyboard mapping. For example, if you create a site default settings file with Secure Shell configured as the connection type, when Reflection is launched without a settings file, the site default settings file is loaded configuring Secure Shell as the connection type. If new settings are configured by a user during this session and then saved, the new settings and the site default settings will be saved to the same settings file. If a user sets Reflection to default settings, the site default settings that you defined will be used.
However, when Reflection is launched with prior version settings file, the site default settings file is not loaded, and therefore, the existing connection type remains as it was originally configured (the connection type is not changed to Secure Shell). If you want to migrate prior version settings files to change the connection type, you can use the Reflection Profiler to run a macro that will update these files.
The Reflection Profiler has a feature that enables you to use the Reflection scripting languages to run a macro, or script, when a settings file is loaded. When you use this feature to associate a macro with a settings file, when the settings are loaded, the associated macro is run prior to connection. By doing this you can introduce updated information to older settings files without having to manually update each file. For example, you can change the connection type to Secure Shell.
To configure Reflection to use Secure Shell connections for all new settings files, create a site default settings file with the Connection Type set to Secure Shell. This will also set Connection Setting SSH Term Type to VT220. Once created, use the Reflection Profiler to configure Reflection to reference the site default settings file whenever a new settings file is created.
To configure Secure Shell connection settings:
Note: Prior to version 13.0, Secure Shell was called OpenSSH.
Save your settings file to a shared location on a network server or locally on the workstation. If you plan to deploy the site default file to users' workstations, save it to the same location as the Reflection executable (Program Files\Reflection).
Once you have created the site default settings file, you can use the Reflection Profiler to configure Reflection to reference this settings file whenever a Reflection session is opened without a settings file. Use the Reflection Customization Manager (called Reflection Deployment Manager in versions earlier than 12.0) to run the Profiler and incorporate the site defaults into your deployment.
Note: Reflection for Windows versions 10.0.0 through 10.0.2 does not support environment variable names in the path to the settings file. Starting in version 10.0.3, you can use environment variable names such as %ProgramFiles%.
To configure prior version Reflection settings files to use Secure Shell connections, you must create and save a migration macro. Once created, use the Reflection Profiler to configure Reflection to run the macro when opening a settings file.
Use the migration macro below to convert prior version settings files to use a Secure Shell connection.
When Reflection is launched and a settings file is opened, this migration macro checks the connection type. If the connection type is not Secure Shell, the macro saves the current host name, changes the connection type, and prompts for the user name.
To use this macro,
Sub SetSSH() With Session If .ConnectionType <> "OpenSSH" Then 'Save the hostname if currently set. This value is 'set to null when you change the value of .ConnectionType. myHostName = .ConnectionSetting("Host") 'Set connection to OpenSSH. .ConnectionType = "OpenSSH" 'If the host name is empty, then prompt user to supply it. If myHostName = "" Then myHostName = .InputBox("Host to connect", _ "OpenSSH Host Name") If myHostName = "" Then Exit Sub End If End If .ConnectionSettings = "Host " & myHostName 'Find out the username myUserName = .ConnectionSetting("UserName") 'If the UserName is empty prompt the user to supply it. If myUserName = "" Then myUserName = .InputBox("Please enter your user name.", _ "OpenSSH UserName") If myUserName = "" Then Exit Sub End If .ConnectionSettings = "UserName " & myUserName End IfEnd WithEnd Sub |
Configure the Reflection Profiler to run the script when opening a prior version settings file. Use the Reflection Customization Manager (called Reflection Deployment Manager in versions earlier than 12.0) to run the macro.
C:\Program Files\Reflection\SiteSSH.r2w/module1.SetSSHThis will configure the script to run whenever a prior version settings file is opened.