── nodes shell ──────────────────────────────────────────────────────────────
()
| 189 | // ── nodes shell ────────────────────────────────────────────────────────────── |
| 190 | |
| 191 | func newNodesShellCmd() *cobra.Command { |
| 192 | return &cobra.Command{ |
| 193 | Use: "shell <node>", |
| 194 | Short: "Open an interactive SSH shell on a node", |
| 195 | Long: `Open an interactive SSH shell on a Proxmox node. |
| 196 | |
| 197 | The SSH user is resolved from the node's source profile (in group mode), the |
| 198 | active profile, or the global ssh_user config / --ssh-user flag. Authentication |
| 199 | follows the standard SSH priority: agent > configured keyfile > ~/.ssh defaults.`, |
| 200 | Example: ` pvetui nodes shell pve01 |
| 201 | pvetui --profile prod nodes shell pve01 |
| 202 | pvetui --ssh-user root nodes shell pve01`, |
| 203 | Args: cobra.ExactArgs(1), |
| 204 | RunE: runNodesShell, |
| 205 | ValidArgsFunction: completeNodeNames, |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | func runNodesShell(cmd *cobra.Command, args []string) error { |
| 210 | nodeName := args[0] |