Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(563)

Issue 48370043: Introduce go.crypto/ssh support

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by axw
Modified:
10 years, 4 months ago
Reviewers:
mp+200628, thumper
Visibility:
Public.

Description

Introduce go.crypto/ssh support A new "client key directory" is introduced, which may contain one or more SSH key pairs. The client key directory is initialised to $JUJU_HOME/ssh in juju/conn.go. If the directory does not exist, it is created with a new 2048-bit RSA keypair. If the default SSH client is not available at bootstrap time, then a go.crypto/ssh client will be used; this client will attempt to use each of the key pairs it finds in the client key directory. The OpenSSH client (in utils/ssh/ssh_openssh.go) is modified to use any of the default SSH identities, or any of the ones found in the client key directory. Fixes #1263851 https://code.launchpad.net/~axwalk/juju-core/ssh-gocrypto-client/+merge/200628 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+1116 lines, -188 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M cloudinit/sshinit/configure.go View 3 chunks +14 lines, -6 lines 1 comment Download
M cmd/juju/scp.go View 1 chunk +3 lines, -5 lines 0 comments Download
M cmd/juju/scp_test.go View 2 chunks +7 lines, -1 line 0 comments Download
M cmd/juju/ssh.go View 1 chunk +4 lines, -1 line 0 comments Download
M cmd/juju/ssh_test.go View 2 chunks +5 lines, -12 lines 0 comments Download
M environs/config/authkeys.go View 2 chunks +14 lines, -6 lines 1 comment Download
M environs/manual/fakessh.go View 5 chunks +21 lines, -12 lines 1 comment Download
M environs/manual/init.go View 4 chunks +14 lines, -4 lines 0 comments Download
M environs/manual/init_test.go View 1 chunk +4 lines, -4 lines 0 comments Download
M environs/manual/provisioner.go View 1 chunk +3 lines, -3 lines 0 comments Download
M environs/sshstorage/storage.go View 3 chunks +7 lines, -5 lines 1 comment Download
M environs/sshstorage/storage_test.go View 3 chunks +26 lines, -18 lines 0 comments Download
M environs/testing/bootstrap.go View 2 chunks +2 lines, -1 line 0 comments Download
M juju/conn.go View 7 chunks +10 lines, -8 lines 0 comments Download
M juju/conn_test.go View 2 chunks +9 lines, -6 lines 0 comments Download
M provider/common/bootstrap.go View 13 chunks +29 lines, -9 lines 0 comments Download
M provider/common/bootstrap_test.go View 8 chunks +8 lines, -7 lines 0 comments Download
M utils/ssh/authorisedkeys.go View 1 chunk +1 line, -1 line 0 comments Download
A utils/ssh/clientkeys.go View 1 chunk +193 lines, -0 lines 0 comments Download
A utils/ssh/clientkeys_test.go View 1 chunk +139 lines, -0 lines 0 comments Download
M utils/ssh/ssh.go View 1 chunk +145 lines, -62 lines 1 comment Download
A utils/ssh/ssh_gocrypto.go View 1 chunk +197 lines, -0 lines 1 comment Download
A utils/ssh/ssh_openssh.go View 1 chunk +180 lines, -0 lines 0 comments Download
M utils/ssh/ssh_test.go View 2 chunks +48 lines, -17 lines 0 comments Download
M utils/trivial.go View 1 chunk +10 lines, -0 lines 1 comment Download
M utils/trivial_test.go View 1 chunk +21 lines, -0 lines 0 comments Download

Messages

Total messages: 3
axw
Please take a look.
10 years, 4 months ago (2014-01-07 06:38:02 UTC) #1
axw
On 2014/01/07 06:38:02, axw wrote: > Please take a look. I'm going to split this ...
10 years, 4 months ago (2014-01-10 03:33:04 UTC) #2
thumper
10 years, 4 months ago (2014-01-10 03:59:23 UTC) #3
I think the general approach is good, but there will be issues with the identity
file that my branch has introduced.

https://codereview.appspot.com/48370043/diff/1/cloudinit/sshinit/configure.go
File cloudinit/sshinit/configure.go (right):

https://codereview.appspot.com/48370043/diff/1/cloudinit/sshinit/configure.go...
cloudinit/sshinit/configure.go:54: cmd.Stdin = strings.NewReader(script)
One thing I noticed was the need for a carriage return on the end.
Does the script end with a new line?

https://codereview.appspot.com/48370043/diff/1/environs/config/authkeys.go
File environs/config/authkeys.go (right):

https://codereview.appspot.com/48370043/diff/1/environs/config/authkeys.go#ne...
environs/config/authkeys.go:40: var err error
Wondering if this function should perhaps be moved into utils/ssh?

https://codereview.appspot.com/48370043/diff/1/environs/manual/fakessh.go
File environs/manual/fakessh.go (right):

https://codereview.appspot.com/48370043/diff/1/environs/manual/fakessh.go#new...
environs/manual/fakessh.go:33: head >/dev/null
Given the number of different places we mock out the ssh executable, wondering
if we should have some standard place for things like this, perhaps
"testing/ssh" ?

https://codereview.appspot.com/48370043/diff/1/environs/sshstorage/storage.go
File environs/sshstorage/storage.go (right):

https://codereview.appspot.com/48370043/diff/1/environs/sshstorage/storage.go...
environs/sshstorage/storage.go:48: return ssh.Command(host, []string{"bash",
"-c", command}, &options)
bash or /bin/bash ??

We have both in the codebase, and I think we should be consistent with
ourselves.

Personally I don't care too much which we choose, just that we have one.

https://codereview.appspot.com/48370043/diff/1/utils/ssh/ssh.go
File utils/ssh/ssh.go (right):

https://codereview.appspot.com/48370043/diff/1/utils/ssh/ssh.go#newcode18
utils/ssh/ssh.go:18: passwordAuthDisabled bool
hmm.. one of my branches adds an identity file option using the old way.  This
will need to be taken into account some how.

https://codereview.appspot.com/48370043/diff/1/utils/ssh/ssh_gocrypto.go
File utils/ssh/ssh_gocrypto.go (right):

https://codereview.appspot.com/48370043/diff/1/utils/ssh/ssh_gocrypto.go#newc...
utils/ssh/ssh_gocrypto.go:39: func (c *GoCryptoClient) Command(host string,
command []string, options *Options) *Cmd {
Lots of public functions missing docs.

https://codereview.appspot.com/48370043/diff/1/utils/trivial.go
File utils/trivial.go (right):

https://codereview.appspot.com/48370043/diff/1/utils/trivial.go#newcode66
utils/trivial.go:66: // quotes as necessary; each argument is single-quoted.
this isn't escaping slashes... is it?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b