Difference between revisions of "SSH Settings"
(→Terminal) |
|||
Line 1: | Line 1: | ||
− | An SSH connection to an OpenVMS machine is required for syncing source code files, building, running and debugging projects. Depending on the type of configuration, SSH connection settings can be edited either in the ''vmssoftware.ssh-helper-settings.json'' file located in ''/.vscode'' directory or via Visual Studio Code settings page. | + | An SSH connection to an OpenVMS machine is required for syncing source code files, building, running, and debugging projects. <br> |
+ | Depending on the type of configuration, SSH connection settings can be edited either in the '''vmssoftware.ssh-helper-settings.json''' file located in ''/.vscode'' directory or via '''Visual Studio Code''' settings page. | ||
=SSH Settings Template= | =SSH Settings Template= | ||
Line 27: | Line 28: | ||
=Connection= | =Connection= | ||
− | The connection section sets the current connection details. | + | The '''connection''' section sets the current connection details. |
− | * <code>''' | + | * <code>'''host'''</code> - IP-address or name of an OpenVMS machine or the label of a predefined connection from the '''host collection''' section |
case, all other fields are ignored. | case, all other fields are ignored. | ||
− | * <code>''' | + | * <code>'''port'''</code> - The port number to use for the SSH connection. Default is 22. |
− | * <code>''' | + | * <code>'''username'''</code> - User account that will be used for the SSH connection. |
− | * <code>''' | + | * <code>'''password'''</code> - User password that will be used for the SSH connection.. If it is omitted a password input box will be shown on connection attempt. |
− | * <code>''' | + | * <code>'''keyFile'''</code> - Path to SSH private key file. For details on how to configure connection using SSH key, see [https://raymii.org/s/blog/SSH_public_key_authentication_on_OpenVMS.html SSH public key authentication on OpenVMS] |
* <code>'''skipSignatureVerification'''</code> - Skip signature verification. Set it to 'true' if an error 'Handshake failed: signature verification failed' occurs. | * <code>'''skipSignatureVerification'''</code> - Skip signature verification. Set it to 'true' if an error 'Handshake failed: signature verification failed' occurs. | ||
− | Required fields | + | Required fields are: |
− | + | * <code>'''host'''</code> | |
− | + | * <code>'''username'''</code> | |
− | + | You may use either password or key file to establish connection: | |
− | + | * <code>'''keyFile'''</code> | |
− | + | * <code>'''password'''</code> | |
− | If ''' | + | If '''keyFile''' is not set, '''password''' is used. If neither '''password''' nor '''keyFile''' is specified, you will be prompted to enter your password during the connection attempt. |
=Host Collection= | =Host Collection= | ||
− | If you need to connect to different servers when working on your project, it makes sense to list | + | If you need to connect to different servers when working on your project, it makes sense to create a list of required connections to be able to quickly connect to any of them. |
− | + | You can do this by adding all the required connections to the '''Host Collection''' list. | |
− | + | === Adding a new host to collection === | |
+ | To add a new host to the collection: | ||
+ | <ol> | ||
+ | <li>Copy the ssh connection template to '''host-collection.hosts''' array:</li> | ||
+ | <pre>"host-collection": { | ||
+ | "hosts": [ | ||
+ | { | ||
+ | "host": "<First>", | ||
+ | "keyFile": "", | ||
+ | "password": "", | ||
+ | "port": 22, | ||
+ | "username": "", | ||
+ | "skipSignatureVerification": false | ||
+ | } | ||
+ | ] | ||
+ | }</pre> | ||
+ | <li>Specify connection parameters</li> | ||
+ | <li>Make sure that '''label''' parameter is set.</li> | ||
+ | </ol> | ||
− | To | + | ===Selecting which connection to use=== |
− | + | To use one of connections from the '''host collection''' section, copy the value of ''label'' and paste it in angle brackets ('''<label>''') to the '''host''' field in the '''connection''' section. | |
− | |||
− | |||
− | |||
− | + | === Example === | |
<pre> | <pre> | ||
{ | { | ||
"connection": { | "connection": { | ||
− | "host": "< | + | "host": "<MySSHConnection>", |
"keyFile": "", | "keyFile": "", | ||
"password": "", | "password": "", | ||
Line 72: | Line 88: | ||
"hosts": [ | "hosts": [ | ||
{ | { | ||
− | "host": " | + | "host": "10.10.6.1", |
"keyFile": "", | "keyFile": "", | ||
− | "password": " | + | "password": "myPassword", |
"port": 22, | "port": 22, | ||
"username": "user", | "username": "user", | ||
"skipSignatureVerification": true, | "skipSignatureVerification": true, | ||
− | "label": " | + | "label": "MySSHConnection" |
} | } | ||
] | ] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
} | } | ||
</pre> | </pre> | ||
+ | |||
+ | '''NOTE''': If you use VSC type of configuration, you will not be able to specify host collection in UI. Instead, you need to click "Edit in settings.json" and specify them in the '''settings.json''' file. | ||
+ | |||
+ | [[File:Ssh collection hosts.png|Ssh collection hosts.png]] | ||
=Timeouts= | =Timeouts= | ||
− | + | You can define SSH connection timeouts in this section. | |
− | * <code>''' | + | * <code>'''cmdTimeout'''</code> - Timeout for command response. If a command is sent to the OpenVMS system and the OpenVMS system does not a send response for the specified period of time, it will be considered as rejected. |
− | * <code>''' | + | * <code>'''feedbackTimeout'''</code> - If the SSH connection does not send feedback for the specified interval, the password will be considered as invalid. |
− | * <code>''' | + | * <code>'''welcomeTimeout'''</code> - If the SSH shell prompt is not received within this interval, the shell will be closed. |
'''NOTE''': Value "0" means, that timeout is not used. | '''NOTE''': Value "0" means, that timeout is not used. | ||
'''WARN''': Do not change timeout settings unless necessary. | '''WARN''': Do not change timeout settings unless necessary. | ||
+ | |||
+ | ===Example=== | ||
+ | <pre> | ||
+ | "timeouts": { | ||
+ | "cmdTimeout": 0, | ||
+ | "feedbackTimeout": 0, | ||
+ | "welcomeTimeout": 0 | ||
+ | } | ||
+ | </pre> | ||
=Terminal= | =Terminal= | ||
+ | Specifies command to start the shell in the VS Code integrated terminal. | ||
+ | * <code>'''Command'''</code> - command to start the shell. | ||
− | + | '''NOTE:''' It is possible to use variables in the command. The syntax is: ${variable} or ${varable?<text if variable isn't empty>}. Supported variables: '''host''', '''port''', '''username''', '''password''', and '''keyFile'''. | |
− | + | '''NOTE:''' password may come from settings or UI prompt that is shown if the password is not specified in settings. Passwords entered in the terminal are not saved. | |
− | + | ===Example=== | |
+ | <pre> | ||
+ | "terminal": { | ||
+ | "command": "ssh -oHostKeyAlgorithms=+ssh-dss ${keyFile?-i ${keyFile}} ${username?${username}@}${host}" | ||
+ | } | ||
+ | </pre> | ||
[[Category:VMS IDE]] | [[Category:VMS IDE]] |
Revision as of 13:53, 21 August 2019
An SSH connection to an OpenVMS machine is required for syncing source code files, building, running, and debugging projects.
Depending on the type of configuration, SSH connection settings can be edited either in the vmssoftware.ssh-helper-settings.json file located in /.vscode directory or via Visual Studio Code settings page.
Contents
SSH Settings Template
{ "connection": { "host": "", "keyFile": "", "password": "", "port": 22, "username": "", "skipSignatureVerification": false, }, "host-collection": { "hosts": [] }, "timeouts": { "cmdTimeout": 0, "feedbackTimeout": 0, "welcomeTimeout": 0 }, "terminal": { "command": "ssh -oHostKeyAlgorithms=+ssh-dss ${keyFile?-i ${keyFile}} ${username?${username}@}${host}" } }
Connection
The connection section sets the current connection details.
host
- IP-address or name of an OpenVMS machine or the label of a predefined connection from the host collection section
case, all other fields are ignored.
port
- The port number to use for the SSH connection. Default is 22.username
- User account that will be used for the SSH connection.password
- User password that will be used for the SSH connection.. If it is omitted a password input box will be shown on connection attempt.keyFile
- Path to SSH private key file. For details on how to configure connection using SSH key, see SSH public key authentication on OpenVMSskipSignatureVerification
- Skip signature verification. Set it to 'true' if an error 'Handshake failed: signature verification failed' occurs.
Required fields are:
host
username
You may use either password or key file to establish connection:
keyFile
password
If keyFile is not set, password is used. If neither password nor keyFile is specified, you will be prompted to enter your password during the connection attempt.
Host Collection
If you need to connect to different servers when working on your project, it makes sense to create a list of required connections to be able to quickly connect to any of them. You can do this by adding all the required connections to the Host Collection list.
Adding a new host to collection
To add a new host to the collection:
- Copy the ssh connection template to host-collection.hosts array:
- Specify connection parameters
- Make sure that label parameter is set.
"host-collection": { "hosts": [ { "host": "<First>", "keyFile": "", "password": "", "port": 22, "username": "", "skipSignatureVerification": false } ] }
Selecting which connection to use
To use one of connections from the host collection section, copy the value of label and paste it in angle brackets (<label>) to the host field in the connection section.
Example
{ "connection": { "host": "<MySSHConnection>", "keyFile": "", "password": "", "port": 22, "username": "", "skipSignatureVerification": false }, "host-collection": { "hosts": [ { "host": "10.10.6.1", "keyFile": "", "password": "myPassword", "port": 22, "username": "user", "skipSignatureVerification": true, "label": "MySSHConnection" } ] } }
NOTE: If you use VSC type of configuration, you will not be able to specify host collection in UI. Instead, you need to click "Edit in settings.json" and specify them in the settings.json file.
Timeouts
You can define SSH connection timeouts in this section.
cmdTimeout
- Timeout for command response. If a command is sent to the OpenVMS system and the OpenVMS system does not a send response for the specified period of time, it will be considered as rejected.feedbackTimeout
- If the SSH connection does not send feedback for the specified interval, the password will be considered as invalid.welcomeTimeout
- If the SSH shell prompt is not received within this interval, the shell will be closed.
NOTE: Value "0" means, that timeout is not used.
WARN: Do not change timeout settings unless necessary.
Example
"timeouts": { "cmdTimeout": 0, "feedbackTimeout": 0, "welcomeTimeout": 0 }
Terminal
Specifies command to start the shell in the VS Code integrated terminal.
Command
- command to start the shell.
NOTE: It is possible to use variables in the command. The syntax is: ${variable} or ${varable?<text if variable isn't empty>}. Supported variables: host, port, username, password, and keyFile. NOTE: password may come from settings or UI prompt that is shown if the password is not specified in settings. Passwords entered in the terminal are not saved.
Example
"terminal": { "command": "ssh -oHostKeyAlgorithms=+ssh-dss ${keyFile?-i ${keyFile}} ${username?${username}@}${host}" }