-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support native ssh client #615
Conversation
Codecov Report
@@ Coverage Diff @@
## master #615 +/- ##
==========================================
- Coverage 47.95% 47.90% -0.06%
==========================================
Files 225 224 -1
Lines 16787 16818 +31
==========================================
+ Hits 8051 8057 +6
- Misses 7610 7631 +21
- Partials 1126 1130 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
pkg/cluster/executor/ssh.go
Outdated
args = append(args, "-i", e.Config.KeyFile) | ||
} | ||
if e.Config.Passphrase != "" { | ||
args = append([]string{"sshpass", "-p", e.Config.Passphrase, "-P", "passphrase"}, args...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure the sshpass
always exists in the user environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, It's a tradeoff. I think it's not a hard task to install it in the bastion host. It's not economical enough for us to implement sshpass
in our code.
08c7e12
to
c5feef7
Compare
Sudo: sudo, | ||
} | ||
if c.Password != "" || (c.KeyFile != "" && c.Passphrase != "") { | ||
_, _, e.ConnectionTestResult = e.Execute(connectionTestCommand, false, executeDefaultTimeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't try to connect remote when we create the instance of SSHExecutor
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we don't try it this time when the user actually executes the command, it may block as long as the command timeout value since the wrong prompt of ssh. What's worse is that there will be no possibility to get clear what happened at that time.
For example, the user can change the ssh prompt to:
root@172.16.5.141's secret:
But the sshpass
may expect it be:
root@172.16.5.141's password:
And then the command will hang forever (until receiving the kill signal).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
Well done.
Signed-off-by: lucklove <gnu.crazier@gmail.com>
- Support password Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Co-authored-by: Lonng <heng@lonng.org>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
Signed-off-by: lucklove <gnu.crazier@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
document for pingcap/tiup#615 Signed-off-by: lucklove <gnu.crazier@gmail.com>
document for pingcap/tiup#615 Signed-off-by: lucklove <gnu.crazier@gmail.com>
* Add document for tiup-cluster document for pingcap/tiup#615 Signed-off-by: lucklove <gnu.crazier@gmail.com> * Update tiup/tiup-cluster.md Co-authored-by: Lonng <heng@lonng.org> * Address comment Signed-off-by: lucklove <gnu.crazier@gmail.com> * Update tiup/tiup-cluster.md Co-authored-by: Lonng <heng@lonng.org> Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
At current we use easyssh as the ssh tunnel. However, sometimes users will use some ssh plugin such as LDAP. In this case the easyssh client can't work.
This PR introduces an option for users to choose the native ssh client in his host as the ssh client to connect the cluster. This can enable any ssh plugins once the user configs them correctly.
TODOLIST:
--native-ssh
global flag