diff --git a/docs/documentation/platform/ssh.mdx b/docs/documentation/platform/ssh.mdx index 1f8856a5b..8b04552e7 100644 --- a/docs/documentation/platform/ssh.mdx +++ b/docs/documentation/platform/ssh.mdx @@ -136,15 +136,17 @@ Once Infisical SSH is configured by an administrator, users can SSH to the remot Follow the instructions [here](/cli/overview) to install the Infisical CLI onto your local machine. - - Run the `infisical login` command to authenticate with Infisical. - + + The `infisical ssh connect` command can be used in either interactive or non-interactive mode to connect to a remote host. + + ### Interactive Mode + In interactive mode, you'll first need to authenticate with Infisical by running: + ```bash infisical login ``` - - - Run the `infisical ssh connect` command to connect to a remote host. + + Then simply run: ```bash infisical ssh connect @@ -174,6 +176,23 @@ Once Infisical SSH is configured by an administrator, users can SSH to the remot ✔ SSH credentials successfully added to agent Connecting to ec2-user@ec2-12-345-678-910.ap-northeast-1.compute.amazonaws.com... ``` + + ### Non-Interactive Mode + For CI/CD pipelines or automation scenarios, you can use the non-interactive mode with an Infisical token: + + ```bash + infisical ssh connect \ + --hostname ec2-12-345-678-910.ap-northeast-1.compute.amazonaws.com \ + --loginUser ec2-user \ + --outFilePath ~/.ssh/id_rsa-cert.pub \ + --token + ``` + + This will: + - Connect to the specified hostname + - Use the specified login user + - Write the SSH credentials to the specified path instead of adding them to the SSH agent + - Authenticate using the provided Infisical token