From 3d5101011f924d39d0bfe1075b38c7ffe676e2bc Mon Sep 17 00:00:00 2001 From: Shawn Wang Date: Wed, 12 Dec 2018 23:39:25 +0800 Subject: [PATCH] Fix userkey create, missing AuthorizedKey --- shell.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/shell.go b/shell.go index 40bc262..b903e61 100644 --- a/shell.go +++ b/shell.go @@ -16,6 +16,8 @@ import ( "github.com/mgutz/ansi" "github.com/moby/moby/pkg/namesgenerator" "github.com/moul/ssh" + gossh "golang.org/x/crypto/ssh" + "github.com/olekukonko/tablewriter" "github.com/urfave/cli" "golang.org/x/crypto/ssh/terminal" @@ -1925,9 +1927,10 @@ GLOBAL OPTIONS: } userkey := UserKey{ - User: &user, - Key: key.Marshal(), - Comment: comment, + User: &user, + Key: key.Marshal(), + Comment: comment, + AuthorizedKey: string(gossh.MarshalAuthorizedKey(key)), } if c.String("comment") != "" { userkey.Comment = c.String("comment")