|
| 1 | +--- |
| 2 | +title: How to restrict serial port access and set timeout on terminal server |
| 3 | +description: Process of configuring serial port access restrictions and timeout settings on terminal server |
| 4 | +author: sushantjrao |
| 5 | +ms.author: sushrao |
| 6 | +ms.service: azure-operator-nexus |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 01/24/2024 |
| 9 | +ms.custom: template-how-to, devx-track-azurecli |
| 10 | +--- |
| 11 | + |
| 12 | +# How to restrict serial port access to a single session and set a 15-Minute timeout on a Terminal Server |
| 13 | + |
| 14 | +This guide explains how to configure a Terminal Server to restrict serial port access to a single session and set the default timeout to 15 minutes. |
| 15 | + |
| 16 | +## Prerequisites |
| 17 | + |
| 18 | +- **Terminal Server requirements**: Ensure the Terminal Server is running OS version `24.07.1` or above. |
| 19 | + For upgrade instructions, refer to [How to Upgrade Terminal Server OS](howto-upgrade-os-of-terminal-server.md). |
| 20 | + |
| 21 | + |
| 22 | +## Step 1: Set timeout for sessions |
| 23 | + |
| 24 | +Configure the session timeouts for CLI, WebUI, and Serial Port access using the following commands: |
| 25 | + |
| 26 | +```bash |
| 27 | +ogcli update system/cli_session_timeout timeout=15 |
| 28 | +ogcli update system/webui_session_timeout timeout=15 |
| 29 | +ogcli update system/session_timeout serial_port_timeout=15 |
| 30 | +``` |
| 31 | + |
| 32 | +## Step 2: Verify timeout settings |
| 33 | + |
| 34 | +Confirm the new timeout settings by running: |
| 35 | + |
| 36 | +```bash |
| 37 | +ogcli get system/session_timeout |
| 38 | +``` |
| 39 | + |
| 40 | +```Expected output: |
| 41 | +cli_timeout=15 |
| 42 | +serial_port_timeout=15 |
| 43 | +webui_timeout=15 |
| 44 | +``` |
| 45 | + |
| 46 | +## Step 3: Configure single session for serial ports |
| 47 | + |
| 48 | +To restrict each serial port to a single session, execute the following command. |
| 49 | + |
| 50 | +```bash |
| 51 | +for i in {01..48} ; do |
| 52 | + echo "### Configuring single_session on port$i ###" |
| 53 | + ogcli update port port$i single_session=true |
| 54 | +done |
| 55 | +``` |
| 56 | + |
| 57 | +>[!Note:] |
| 58 | +> This process may take approximately 15 minutes. |
| 59 | +
|
| 60 | +## Step 4: Verify single session configuration |
| 61 | + |
| 62 | +Validate the configuration by listing the ports and checking the `single_session` status: |
| 63 | + |
| 64 | +```bash |
| 65 | +ogcli get ports | grep -E 'ogcli get port|single_session' |
| 66 | +``` |
| 67 | + |
| 68 | +Alternatively, check individual ports: |
| 69 | + |
| 70 | +```bash |
| 71 | +ogcli get port "port01" |
| 72 | +``` |
| 73 | + |
| 74 | +```Expected output for each port: |
| 75 | +single_session=true |
| 76 | +``` |
| 77 | + |
| 78 | +Repeat the command for other ports as needed (`port02`, `port03`, etc.). |
0 commit comments