summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/manager
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/gitblit/manager')
-rw-r--r--src/main/java/com/gitblit/manager/ServicesManager.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/manager/ServicesManager.java b/src/main/java/com/gitblit/manager/ServicesManager.java
index 17724f2b..93121cfb 100644
--- a/src/main/java/com/gitblit/manager/ServicesManager.java
+++ b/src/main/java/com/gitblit/manager/ServicesManager.java
@@ -228,6 +228,10 @@ public class ServicesManager implements IManager {
}
public String getSshDaemonUrl(HttpServletRequest request, UserModel user, RepositoryModel repository) {
+ if (user == null || UserModel.ANONYMOUS.equals(user)) {
+ // SSH always requires authentication - anonymous access prohibited
+ return null;
+ }
if (sshDaemon != null) {
String bindInterface = settings.getString(Keys.git.sshBindInterface, "localhost");
if (bindInterface.equals("localhost")