-
Notifications
You must be signed in to change notification settings - Fork 494
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
Added note about standard ssh options. #7901
Conversation
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 need a little bit more for people to understand this, possibly an example would be sufficient.
cmd/juju/commands/ssh.go
Outdated
@@ -28,6 +28,9 @@ The SSH host keys of the target are verified. The --no-host-key-checks option | |||
can be used to disable these checks. Use of this option is not recommended as | |||
it opens up the possibility of a man-in-the-middle attack. | |||
|
|||
Options specific to ssh can be provided as well. Refer to the ssh man | |||
page for an explanation of those options. | |||
|
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 feel like this isn't quite complete enough, because I don't think you can pass them at arbitrary points on the command line, they have to come after you specify a target. Maybe something like:
Any arguments passed after the target will be passed directly on to OpenSSH (on platforms where it is available).
Along with a later example of:
Pass extra options to SSH:
juju ssh mysql/0 -i SPECIAL_IDENTITY_FILE echo hello
Thoughts?
The main reason is that I don't think:
juju ssh -i IDENTITY_FILE mysql/0
works, because the '-i' is tried to be interpreted by "juju ssh" and not being passed on to ssh.
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.
This SGTM, but I'd like someone like Peter to give a feel for whether users actually understand this or not.
@pmatulis, |
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.
Here you go. 🐙
cmd/juju/commands/ssh.go
Outdated
Options specific to ssh can be provided as well. In fact, any arguments passed | ||
after the target will be passed directly on to OpenSSH | ||
(on platforms where it is available). | ||
Refer to the ssh man page for an explanation of those options. |
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.
Options can be passed to the local OpenSSH client (ssh) on platforms where it is available. This is done by inserting them between the target and a possible remote command. Refer to the ssh man page for an explanation of those options.
Won't you be updating the usage on line 76?
Args: "<[user@]target> [openssh options] [command]",
Fix the wordwrapping?
cmd/juju/commands/ssh.go
Outdated
@@ -45,6 +50,12 @@ Connect to a jenkins unit as user jenkins: | |||
|
|||
juju ssh jenkins@jenkins/0 | |||
|
|||
Pass extra options to SSH: |
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.
Connect to a mysql unit by passing options to the OpenSSH client. Here, we specify a private key (the default is ~/.ssh/id_rsa
):
cmd/juju/commands/ssh.go
Outdated
|
||
juju ssh mysql/0 -i SPECIAL_IDENTITY_FILE echo hello | ||
|
||
(not 'juju ssh -i SPECIAL_IDENTITY_FILE mysql/0 echo hello') |
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.
Remove this line?
cmd/juju/commands/ssh.go
Outdated
@@ -45,6 +50,12 @@ Connect to a jenkins unit as user jenkins: | |||
|
|||
juju ssh jenkins@jenkins/0 | |||
|
|||
Pass extra options to SSH: | |||
|
|||
juju ssh mysql/0 -i SPECIAL_IDENTITY_FILE echo hello |
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.
juju ssh mysql/0 -i ~/.ssh/my_private_key echo hello
|
Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju |
Description of change
Users were not aware that standard 'ssh' options could also be provided to 'juju ssh' command.
Added a paragraph to a command help, similar in wording to 'juju scp'.
QA steps
'juju help ssh' mentions standard ssh options and man.
Documentation changes
n/a
Bug reference
https://bugs.launchpad.net/juju/+bug/1718775