diff options
author | Jakob Ackermann <das7pad@outlook.com> | 2019-09-16 00:51:40 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-09-15 18:51:40 -0400 |
commit | 89648746a5acd4892a026d2962ff217280dbdf5b (patch) | |
tree | 262dbb2f7d386cfd55df5cdea1f9e18d2760a80a /models | |
parent | 4959bf1c097917576472f9f66afa0fb615500c07 (diff) | |
download | gitea-89648746a5acd4892a026d2962ff217280dbdf5b.tar.gz gitea-89648746a5acd4892a026d2962ff217280dbdf5b.zip |
[ssh] fix the config specification in the authorized_keys template (#8031)
The gitea flags must appear in front of the gitea command. Otherwise
they are ignored.
Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
Diffstat (limited to 'models')
-rw-r--r-- | models/ssh_key.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go index 315b32e8d5..b7c5b4fe6e 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -36,7 +36,7 @@ import ( const ( tplCommentPrefix = `# gitea public key` - tplPublicKey = tplCommentPrefix + "\n" + `command="%s serv key-%d --config='%s'",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s` + "\n" + tplPublicKey = tplCommentPrefix + "\n" + `command="%s --config='%s' serv key-%d",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty %s` + "\n" ) var sshOpLocker sync.Mutex @@ -81,7 +81,7 @@ func (key *PublicKey) OmitEmail() string { // AuthorizedString returns formatted public key string for authorized_keys file. func (key *PublicKey) AuthorizedString() string { - return fmt.Sprintf(tplPublicKey, setting.AppPath, key.ID, setting.CustomConf, key.Content) + return fmt.Sprintf(tplPublicKey, setting.AppPath, setting.CustomConf, key.ID, key.Content) } func extractTypeFromBase64Key(key string) (string, error) { |