Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node operation allows an administrator to create a new public SSH key for a specified user in the system. It is useful in scenarios where you want to programmatically add SSH keys for users, for example, to enable secure access or automate deployment workflows that require SSH authentication.

Practical examples include:

  • Adding a deploy key with read-only access to a user's repository.
  • Creating a new SSH key for a user to allow them to authenticate without passwords.
  • Automating user setup by provisioning their SSH keys via API calls.

Properties

Name Meaning
Username The username of the user to whom the SSH key will be added.
Key The armored SSH public key string to add for the user.
Read Only Boolean flag indicating if the key should have read-only access (true) or read/write.
Title A descriptive title for the SSH key being added.

Output

The node outputs JSON data representing the created public key resource as returned by the API. This typically includes details such as the key's ID, title, fingerprint, and access permissions. There is no binary output.

Dependencies

  • Requires an API key credential configured in n8n to authenticate requests against the target system's API.
  • The base URL for the API must be set in the credentials configuration.
  • The node uses standard HTTP headers for JSON content negotiation.

Troubleshooting

  • Invalid SSH Key Format: If the provided key is not a valid armored SSH public key, the API may reject the request. Ensure the key is correctly formatted.
  • User Not Found: Providing a username that does not exist will result in an error. Verify the username before running the node.
  • Permission Denied: The API key used must have administrative privileges to add keys for other users.
  • Read Only Flag Misuse: Setting the read-only flag incorrectly might cause unexpected permission issues; confirm the intended access level.

Links and References

  • SSH Public Keys
  • Relevant API documentation for managing user SSH keys (specific to the target system, e.g., Gitea or similar).

Discussion