Feature Request: TiUP cluster component supports ssh-key with passphrase
Open
Nobody has claimed this yet.
status/TODO
type/feature-request
- Dominant language
- Go
- Stars
- 466
- Forks
- 338
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 8
Description
General Question
- Currently, TiUP cluster component doesn't support the ssh-key with the passphrase and there is a system risk that exists because 'remote user has the no-password sudo permission'.
- The subsequence operations need input the passphrase for ssh-key when every step, it should be simplified for easy use.
tiup cluster stop nji --ssh=system
Starting component `cluster`: /root/.tiup/components/cluster/v1.2.3/tiup-cluster stop nji --ssh=system
+ [ Serial ] - SSHKeySet: privateKey=/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa, publicKey=/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa.pub
+ [Parallel] - UserSSH: user=tidb, host=172.16.4.178
+ [Parallel] - UserSSH: user=tidb, host=172.16.4.178
+ [Parallel] - UserSSH: user=tidb, host=172.16.4.178
+ [Parallel] - UserSSH: user=tidb, host=172.16.4.178
+ [Parallel] - UserSSH: user=tidb, host=172.16.4.178
+ [ Serial ] - StopCluster
Stopping component grafana
Stopping instance 172.16.4.178
Enter passphrase for key '/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa':
Stop grafana 172.16.4.178:3000 success
Stopping component prometheus
Stopping instance 172.16.4.178
Enter passphrase for key '/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa':
Stop prometheus 172.16.4.178:9090 success
Stopping component tidb
Stopping instance 172.16.4.178
Enter passphrase for key '/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa':
Stop tidb 172.16.4.178:4000 success
Stopping component tikv
Stopping instance 172.16.4.178
Enter passphrase for key '/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa':
Stop tikv 172.16.4.178:20160 success
Stopping component pd
Stopping instance 172.16.4.178
Enter passphrase for key '/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa':
Stop pd 172.16.4.178:2379 success
Stopping component node_exporter
Enter passphrase for key '/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa':
Enter passphrase for key '/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa':
Stopping component blackbox_exporter
Enter passphrase for key '/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa':
Enter passphrase for key '/root/.tiup/storage/cluster/clusters/nji/ssh/id_rsa':
Stopped cluster `nji` successfully
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the TiUP cluster component's tiup cluster stop flow, especially the SSHKeySet and UserSSH steps shown in the output. Trace how the private key at the displayed path is used during each operation. Done means passphrase-protected keys are supported without repeated prompts for every step, while retaining the requested security benefit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100