Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
65804c07
Commit
65804c07
authored
Apr 26, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/null: pass SSH tests
parent
fa339fc2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
builder/null/ssh.go
builder/null/ssh.go
+9
-8
No files found.
builder/null/ssh.go
View file @
65804c07
package
null
import
(
gossh
"code.google.com/p/go
sshold
/ssh"
gossh
"code.google.com/p/go
.crypto
/ssh"
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/communicator/ssh"
...
...
@@ -31,15 +31,15 @@ func SSHConfig(username string, password string, privateKeyFile string) func(mul
}
privateKey
:=
string
(
bytes
)
keyring
:=
new
(
ssh
.
SimpleKeychain
)
if
err
:=
keyring
.
AddPEMKey
(
privateKey
);
err
!=
nil
{
signer
,
err
:=
gossh
.
ParsePrivateKey
([]
byte
(
privateKey
)
)
if
err
!=
nil
{
return
nil
,
fmt
.
Errorf
(
"Error setting up SSH config: %s"
,
err
)
}
return
&
gossh
.
ClientConfig
{
User
:
username
,
Auth
:
[]
gossh
.
ClientAuth
{
gossh
.
ClientAuthKeyring
(
keyring
),
Auth
:
[]
gossh
.
AuthMethod
{
gossh
.
PublicKeys
(
signer
),
},
},
nil
}
else
{
...
...
@@ -47,9 +47,10 @@ func SSHConfig(username string, password string, privateKeyFile string) func(mul
return
&
gossh
.
ClientConfig
{
User
:
username
,
Auth
:
[]
gossh
.
ClientAuth
{
gossh
.
ClientAuthPassword
(
ssh
.
Password
(
password
)),
gossh
.
ClientAuthKeyboardInteractive
(
ssh
.
PasswordKeyboardInteractive
(
password
)),
Auth
:
[]
gossh
.
AuthMethod
{
gossh
.
Password
(
password
),
gossh
.
KeyboardInteractive
(
ssh
.
PasswordKeyboardInteractive
(
password
)),
},
},
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment