Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
216ff5a9
Unverified
Commit
216ff5a9
authored
Nov 21, 2019
by
Martin Holst Swende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/puppeth: make ssh prompt more user-friendly
parent
c5b46a79
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
ssh.go
cmd/puppeth/ssh.go
+14
-9
No files found.
cmd/puppeth/ssh.go
View file @
216ff5a9
...
@@ -129,15 +129,20 @@ func dial(server string, pubkey []byte) (*sshClient, error) {
...
@@ -129,15 +129,20 @@ func dial(server string, pubkey []byte) (*sshClient, error) {
fmt
.
Printf
(
"SSH key fingerprint is %s [MD5]
\n
"
,
ssh
.
FingerprintLegacyMD5
(
key
))
fmt
.
Printf
(
"SSH key fingerprint is %s [MD5]
\n
"
,
ssh
.
FingerprintLegacyMD5
(
key
))
fmt
.
Printf
(
"Are you sure you want to continue connecting (yes/no)? "
)
fmt
.
Printf
(
"Are you sure you want to continue connecting (yes/no)? "
)
text
,
err
:=
bufio
.
NewReader
(
os
.
Stdin
)
.
ReadString
(
'\n'
)
for
{
switch
{
text
,
err
:=
bufio
.
NewReader
(
os
.
Stdin
)
.
ReadString
(
'\n'
)
case
err
!=
nil
:
switch
{
return
err
case
err
!=
nil
:
case
strings
.
TrimSpace
(
text
)
==
"yes"
:
return
err
pubkey
=
key
.
Marshal
()
case
strings
.
TrimSpace
(
text
)
==
"yes"
:
return
nil
pubkey
=
key
.
Marshal
()
default
:
return
nil
return
fmt
.
Errorf
(
"unknown auth choice: %v"
,
text
)
case
strings
.
TrimSpace
(
text
)
==
"no"
:
return
errors
.
New
(
"users says no"
)
default
:
fmt
.
Println
(
"Please answer 'yes' or 'no'"
)
continue
}
}
}
}
}
// If a public key exists for this SSH server, check that it matches
// If a public key exists for this SSH server, check that it matches
...
...
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