> For the complete documentation index, see [llms.txt](https://asus-isg-aidc.gitbook.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asus-isg-aidc.gitbook.io/guide/latest/cli/commandreference/sysconfig.md).

# System Configuration

| Developer | Last modified |
| --------- | ------------- |
| AIDC Team | 2026/07/06    |

## Table of Contents

* [1. Overview](#overview)
* [2. Basic Configuration](#basic-configuration)
* [3. Time Configuration](#time-configuration)
* [4. Subscription Management (RHEL)](#subscription-management-rhel)
* [5. Disk Management](#disk-management)
* [6. Quick Summary](#quick-summary)
* [7. Usage Examples](#usage-examples)

***

## 1. Overview <a href="#overview" id="overview"></a>

{% hint style="warning" %}
**⚠️ Prerequisite: `aidc-cli init` required first**

This command depends on settings saved by [`aidc-cli init`](/guide/latest/cli/commandreference/init.md). Before running it, make sure you have completed:

* [`aidc-cli init inventory`](/guide/latest/cli/commandreference/init.md#inventory) — render the node inventory from `aidc.csv`
* SSH access to the nodes — [`aidc-cli deploy install`](/guide/latest/cli/commandreference/deploy.md) sets this up during OS deployment; for nodes that already have an OS, run [`aidc-cli deploy access-key`](/guide/latest/cli/commandreference/deploy.md) or fill the `password` column in `aidc.csv`
* [`aidc-cli init syscfg-set` / `syscfg-ntp-set`](/guide/latest/cli/commandreference/init.md#system-configuration) — save timezone and NTP settings

For the full setup sequence, see the [Getting Started](/guide/latest/cli/gettingstarted.md) guide.
{% endhint %}

The `syscfg` command handles post-deployment system configuration — including SSH, repositories, system limits, NTP, timezone, subscription management, software RAID, and disk cleanup.

```bash
aidc-cli syscfg <subcommand> [flags]
```

***

## 2. Basic Configuration <a href="#basic-configuration" id="basic-configuration"></a>

### 2.1 `basic-all` — Apply All Basic Configs

Applies all basic system configurations in sequence (SSH, repo, limits, sysctl, hosts, ethers, etc.).

```bash
aidc-cli syscfg basic-all
```

### 2.2 Individual Basic Commands

| Subcommand    | Description                                                    |
| ------------- | -------------------------------------------------------------- |
| `sshd`        | Configure SSH daemon settings                                  |
| `sshkey`      | Deploy SSH keys                                                |
| `repo-rhel`   | Set up RHEL/Rocky package repositories                         |
| `repo-debian` | Set up Ubuntu/Debian package repositories                      |
| `limits`      | Configure system resource limits (`/etc/security/limits.conf`) |
| `sysctl`      | Kernel parameter tuning (`/etc/sysctl.conf`)                   |
| `hosts`       | Manage `/etc/hosts` entries                                    |
| `ethers`      | Manage `/etc/ethers` entries                                   |
| `lmodpath`    | Configure Lmod module path                                     |

**Syntax:**

```bash
aidc-cli syscfg <subcommand> [flags]
```

| Flag            | Short | Required | Description                                                                  |
| --------------- | :---: | :------: | ---------------------------------------------------------------------------- |
| `--config_path` |  `-p` |     ❌    | Specify custom config file path (optional, applies to all basic subcommands) |

**Example:**

```bash
aidc-cli syscfg sshd
aidc-cli syscfg hosts -p /path/to/custom/hosts.conf
```

***

## 3. Time Configuration <a href="#time-configuration" id="time-configuration"></a>

### 3.1 `ntp` — Configure NTP

Sets NTP server configuration on target nodes.

```bash
aidc-cli syscfg ntp -n <ntp-servers>
```

| Flag            | Short | Required | Description                                                                   |
| --------------- | :---: | :------: | ----------------------------------------------------------------------------- |
| `--ntp_servers` |  `-n` |     ❌    | Comma-separated NTP server addresses (omit to reapply existing configuration) |

### 3.2 `timezone-get` — Get Current Timezone

```bash
aidc-cli syscfg timezone-get
```

### 3.3 `timezone-set` — Set Timezone

```bash
aidc-cli syscfg timezone-set -t <timezone>
```

| Flag         | Short | Required | Description                                                                                                    |
| ------------ | :---: | :------: | -------------------------------------------------------------------------------------------------------------- |
| `--timezone` |  `-t` |     ❌    | IANA timezone (e.g., `Asia/Taipei`, `UTC`, `America/New_York`); omit to apply timezone from configuration file |

***

## 4. Subscription Management (RHEL) <a href="#subscription-management-rhel" id="subscription-management-rhel"></a>

### 4.1 `register` — Register Subscription

```bash
# Register with username/password
aidc-cli syscfg subscription register --username <user> --password <pass>

# Register with organization/activation key
aidc-cli syscfg subscription register --org <org-id> --key <activation-key>
```

| Flag         | Short | Required | Description                |
| ------------ | :---: | :------: | -------------------------- |
| `--username` |  `-u` |    ❌\*   | RHEL subscription username |
| `--password` |  `-p` |    ❌\*   | RHEL subscription password |
| `--org`      |  `-o` |    ❌\*   | Organization ID            |
| `--key`      |  `-k` |    ❌\*   | Activation key             |

{% hint style="info" %}
Use either `--username`/`--password` or `--org`/`--key` pair. These are mutually exclusive authentication methods.
{% endhint %}

### 4.2 `unregister` — Unregister Subscription

```bash
aidc-cli syscfg subscription unregister
```

### 4.3 `status` — Check Subscription Status

```bash
aidc-cli syscfg subscription status
```

***

## 5. Disk Management <a href="#disk-management" id="disk-management"></a>

### 5.1 `sw-raid` — Configure Software RAID

```bash
aidc-cli syscfg sw-raid
```

### 5.2 `disk-clean` — Disk Cleanup

Cleans disk configurations based on the specified mode.

```bash
aidc-cli syscfg disk-clean -m <mode>
```

| Flag     | Short | Required | Description                    |
| -------- | :---: | :------: | ------------------------------ |
| `--mode` |  `-m` |     ✅    | Cleanup mode (see table below) |

| Mode             | Description                |
| ---------------- | -------------------------- |
| `raid`           | Clean software RAID arrays |
| `lvm`            | Clean LVM volumes          |
| `lvm-on-raid`    | Clean LVM on top of RAID   |
| `partition-raid` | Clean RAID partitions      |

{% hint style="danger" %}
`disk-clean` destroys data. Ensure backups are in place before using this command.
{% endhint %}

***

## 6. Quick Summary <a href="#quick-summary" id="quick-summary"></a>

| Category     | Subcommands                                                                                                  |
| ------------ | ------------------------------------------------------------------------------------------------------------ |
| Basic        | `basic-all`, `sshd`, `sshkey`, `repo-rhel`, `repo-debian`, `limits`, `sysctl`, `hosts`, `ethers`, `lmodpath` |
| Time         | `ntp`, `timezone-get`, `timezone-set`                                                                        |
| Subscription | `subscription register`, `subscription unregister`, `subscription status`                                    |
| Disk         | `sw-raid`, `disk-clean`                                                                                      |

***

## 7. Usage Examples <a href="#usage-examples" id="usage-examples"></a>

```bash
# Apply all basic configs at once
aidc-cli syscfg basic-all

# Just configure SSH daemon
aidc-cli syscfg sshd

# Set timezone for all nodes
aidc-cli syscfg timezone-set -t Asia/Taipei

# Configure NTP
aidc-cli syscfg ntp -n "time.google.com,time.cloudflare.com"

# Register RHEL subscription
aidc-cli syscfg subscription register --username myuser --password mypass

# Check subscription status
aidc-cli syscfg subscription status

# Clean LVM volumes on specific node
aidc-cli syscfg disk-clean -m lvm -l node01
```
