Command trust new hostkey once
A SSH-related question!
command trust new hostkey once
is a command that can be used to temporarily trust a new host key for a single SSH connection. Here's what it does:
command
: This is a SSH option that allows you to specify a command to be executed when a connection is established.trust
: This option tells SSH to trust the host key of the remote server, even if it's not in the list of known hosts.new hostkey
: This option specifies that the host key is new and has not been seen before.once
: This option tells SSH to trust the new host key only for this single connection. After the connection is closed, the host key will be removed from the list of trusted hosts.
When you use this command, SSH will temporarily trust the new host key for the duration of the connection. This can be useful in situations where you need to connect to a server that has a new host key, such as when a server's host key is changed or when you're connecting to a server for the first time.
Here's an example of how you might use this command:
ssh -o "command trust new hostkey once" user@remote-server
Note that this command should be used with caution, as it allows SSH to trust a new host key without verifying its authenticity. It's generally recommended to use more secure methods to establish trust, such as adding the host key to your list of known hosts or using a SSH key agent.