Skip to content

Commit 5d41e86

Browse files
Set read-only permissions on authorized_keys file (#13)
Prevents users from modifying keys via SFTP.
1 parent f926252 commit 5d41e86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ES.SFTP.Host/Orchestrator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ await ProcessUtil.QuickRun("chown",
416416
authKeysBuilder.AppendLine(await File.ReadAllTextAsync(file));
417417
await File.WriteAllTextAsync(sshAuthKeysPath, authKeysBuilder.ToString());
418418
await ProcessUtil.QuickRun("chown", $"{user.Username} {sshAuthKeysPath}");
419-
await ProcessUtil.QuickRun("chmod", $"600 {sshAuthKeysPath}");
419+
await ProcessUtil.QuickRun("chmod", $"400 {sshAuthKeysPath}");
420420
}
421421

422422

0 commit comments

Comments
 (0)