---
title: "Update host in the known_hosts file"
method: GET
path: "/KnownHosts/update"
tags: ["KnownHosts", "Known SSH Hosts Management"]
---

# Update host in the known_hosts file

`GET /KnownHosts/update`

This function updates a host's entry in the cPanel account's /home/user/.ssh/known_hosts file.

## Query parameters

- `host_name` union, required
  - string, hostname
  - string, ipv4
- `port` integer

## Response `200`

HTTP Request was successful.

- object
  - `apiversion` integer — The version of the API.
  - `func` string — The name of the method called.
  - `module` string — The name of the module called.
  - `result` object
    - `data` object
      - `host` object[] — An array of objects containing the host's information.
        - `host` union — The updated host and its associated key value.
          - string, hostname
          - string, ipv4
        - `key` string — The host's key.
        - `line` string — The host's entry in the `/home/user/.ssh/known_hosts` file, where user is the cPanel account username. A valid entry that includes the hostname or IP address, the key's algorithm, and the public key.
        - `meta` object — An object containing metadata about the host's public key.
          - `algorithm` string — The key's algorithm.
          - `body` string — The host's public key.
          - `md5` string — The key's MD5 fingerprint.
          - `md5-printable` string — A human-readable version of the key's MD5 fingerprint.
          - `sha256` string — The key's SHA-256 fingerprint.
          - `sha256-printable` string — human-readable version of the key's SHA-256 fingerprint.
    - `errors` string[], nullable — List of errors if the API failed.
    - `messages` string[], nullable — List of messages generated by the API.
    - `metadata` object
    - `status` 0 | 1 — * `1` Success. * `0` Failed. Check the `errors` field for more details.
    - `warnings` string[], nullable — List of warnings generated by the API. Warnings describe non-critical failures or other problematic conditions noted while running a API.

---

[API](https://skmtc.net/cpanel/apis/cpanel-uapi.md) · [All operations](https://skmtc.net/cpanel/apis/cpanel-uapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cpanel/cpanel-uapi/revisions/632e2f8e6d04/schema)
