Skip to content

Commit acbca1d

Browse files
committed
do not use strict mode for authorized_keys file
1 parent 0254df7 commit acbca1d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/com/github/stefanbirkner/fakesftpserver/rule/FakeSftpServerRule.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,10 @@ private boolean authenticatePublicKey(
505505
return false;
506506
}
507507
Path path = usernamesAndIdentities.get(username);
508-
return new DefaultAuthorizedKeysAuthenticator(username, path, true).authenticate(username, publicKey, session);
508+
// don't load authorized keys in strict mode
509+
// strict mode forces checks on 'authorized_keys' files for security
510+
// but this is a test rule and CI builders might not force permissions
511+
return new DefaultAuthorizedKeysAuthenticator(username, path, false).authenticate(username, publicKey, session);
509512
}
510513

511514
private void ensureDirectoryOfPathExists(

0 commit comments

Comments
 (0)