File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -304,6 +304,11 @@ func CheckPublicKeyString(content string) (_ string, err error) {
304
304
305
305
// appendAuthorizedKeysToFile appends new SSH keys' content to authorized_keys file.
306
306
func appendAuthorizedKeysToFile (keys ... * PublicKey ) error {
307
+ // Don't need to rewrite this file if builtin SSH server is enabled.
308
+ if setting .SSH .StartBuiltinServer {
309
+ return nil
310
+ }
311
+
307
312
sshOpLocker .Lock ()
308
313
defer sshOpLocker .Unlock ()
309
314
@@ -532,6 +537,11 @@ func DeletePublicKey(doer *User, id int64) (err error) {
532
537
// Note: x.Iterate does not get latest data after insert/delete, so we have to call this function
533
538
// outside any session scope independently.
534
539
func RewriteAllPublicKeys () error {
540
+ //Don't rewrite key if internal server
541
+ if setting .SSH .StartBuiltinServer {
542
+ return nil
543
+ }
544
+
535
545
sshOpLocker .Lock ()
536
546
defer sshOpLocker .Unlock ()
537
547
You can’t perform that action at this time.
0 commit comments