From 169ea267f6d8ed4dd8599b25d80c567c01b3d158 Mon Sep 17 00:00:00 2001 From: Elara Date: Tue, 13 Aug 2024 00:29:44 +0000 Subject: [PATCH] Update Backends --- Backends.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Backends.md b/Backends.md index 970b4b8..6f4475d 100644 --- a/Backends.md +++ b/Backends.md @@ -123,14 +123,16 @@ ssh user:serial.ttyS0.115200.8n1@ssh.example.com If the **file** option is used instead of **directory**, the file name is omitted. +Here's the updated documentation for the `proxy` backend with the `server` and `port` settings replaced by `host` and `hosts`: + ## `proxy` The Proxy backend allows SSH connections to be proxied to another server. ### Settings -- **server** (string): The target server's address. -- **port** (optional, uint): The target server's port. The default is `22`. +- **host** (string): The target server's address in the format `addr:port`. If this is set, it will override **hosts**. +- **hosts** (optional, array of strings): An array of target server addresses in the format `addr:port`. The `addr` portion can accept globs to match with the client-supplied seashell argument. - **user** (optional, string): The user to connect as on the proxy server. If this is not set, **user_map** will be used to determine the right user, or the seashell username will be used if the user doesn't exist in the map. - **privkey** (optional, string): The path to the private key for authentication. If this is not provided, users will be asked for the target server's password when they attempt to connect. - **user_map** (optional, map[string]string): A map from seashell usernames to target server usernames. @@ -149,8 +151,17 @@ permissions = { ### Client Commands -The proxy backend doesn't use the seashell argument, so you will only need to provide the routing path in your ssh command. For example, with a route configured to match `proxy`, you can use the following command: +If the **host** setting is configured, the proxy backend will not use the seashell argument. However, if **hosts** is configured, the argument will be used to match the seashell arguments. + +For example, with a route configured to match `proxy` and **host** provided, you can use the following command: ```bash -ssh user:proxy@ssh.example.com +ssh user:proxy@ssh.example.com # host = "192.168.1.1" +``` + +If the **hosts** array is provided instead and your route is configured to match `proxy\\.(.+)`, you can use commands like the following: + +```bash +ssh user:proxy.node00@ssh.example.com # hosts = ["node[0-9][0-9]"] +ssh user:proxy.192.168.1.1@ssh.example.com # hosts = ["192.168.1.*"] ``` \ No newline at end of file