Redgate Monitor 14

Set-RedgateMonitorSshHostKey

Sets the SSH host key that Redgate Monitor trusts for a Linux machine.

Syntax

Set-RedgateMonitorSshHostKey [-LinuxMachine] <LinuxMachine> [-SshHostKey] <string> [<CommonParameters>]

Description

The Set-RedgateMonitorSshHostKey cmdlet sets the SSH host key that Redgate Monitor trusts for a Linux machine. Redgate Monitor then connects to the machine only when the machine presents this key.

To get the key, run this command on the machine:

cat /etc/ssh/ssh_host_*_key.pub | ssh-keygen -lf -

The command prints one line for each host key, for example "256 SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s root@linux-box (ED25519)". Give one of these lines, as printed, as the SSH host key.

Connect-RedgateMonitor must be called before this cmdlet.

Parameters

-LinuxMachine <LinuxMachine>

The Linux machine to set the SSH host key for. For more information, see https://www.red-gate.com/monitor14/powershell-custom-types#CustomTypes-LinuxMachine.

Aliases None
Required? true
Position? 1
Default Value None
Accept Pipeline Input True (ByValue)
Accept Wildcard Characters false

-SshHostKey <String>

The SSH host key, as one line of ssh-keygen -lf output.

Aliases None
Required? true
Position? 2
Default Value None
Accept Pipeline Input False
Accept Wildcard Characters false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable, and -ProgressAction. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Examples

-------------------------- EXAMPLE 1 --------------------------

Get-RedgateMonitorMonitoredObject -Type Machine -Name 'linux-box' | Set-RedgateMonitorSshHostKey -SshHostKey '256 SHA256:uNiVztksCsDhcc0u9e8BujQXVUpKZIDTMczCvj3tD2s root@linux-box (ED25519)'

This documentation contains proprietary information and is protected by copyright law.
Copyright © 2026 Red Gate Software Limited. All rights reserved


Didn't find what you were looking for?