Skip to content

Commit 9016cc2

Browse files
authored
Fix login using authorized keys (#25)
Fixed login using authorized keys by setting minimal permissions on the user's home directory.
1 parent e2fad5f commit 9016cc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ES.SFTP.Host/Security/UserManagementService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private async Task SyncUsersAndGroups()
112112

113113
var homeDir = Directory.CreateDirectory(Path.Combine(HomeBasePath, user.Username));
114114
await ProcessUtil.QuickRun("chown", $"root:root {homeDir.FullName}");
115-
await ProcessUtil.QuickRun("chmod", $"700 {homeDir.FullName}");
115+
await ProcessUtil.QuickRun("chmod", $"711 {homeDir.FullName}");
116116

117117
var sshDir = Directory.CreateDirectory(Path.Combine(homeDir.FullName, ".ssh"));
118118
var sshKeysDir = Directory.CreateDirectory(Path.Combine(sshDir.FullName, "keys"));

0 commit comments

Comments
 (0)