ssh_connect
Connect to a remote server over SSH using password, private key, or agent authentication. Optionally run a command after connecting or save settings for future auto-connects.
Instructions
Establish an SSH connection to a remote server. If no parameters are provided, auto-connects using environment variables or saved config. Supports password, private key, and agent authentication. Optionally save the config and/or execute a command after connecting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | SSH server hostname or IP. If omitted, auto-reads from env vars or saved config. | |
| name | No | Use a pre-configured host from hosts.json by name. | |
| port | No | SSH port | |
| command | No | Optional command to execute immediately after connecting. | |
| password | No | SSH password for password-based auth. | |
| username | No | SSH username. If omitted, auto-reads from env vars. | |
| passphrase | No | Passphrase for encrypted private key. | |
| auth_method | No | Authentication method. | private_key |
| save_config | No | Save connection settings to local config file for future use. | |
| sudo_password | No | Sudo password (optional). When set, ssh_execute with use_sudo=true will auto-wrap commands with sudo -S, avoiding plaintext password in process list. | |
| private_key_path | No | Path to private key file for key-based auth. | |
| accept_new_host_key | No | Auto-accept new host keys. |