Index: client/src/main/java/org/apache/karaf/client/Main.java =================================================================== --- client/src/main/java/org/apache/karaf/client/Main.java (revision 1412072) +++ client/src/main/java/org/apache/karaf/client/Main.java (working copy) @@ -18,6 +18,7 @@ import java.io.BufferedReader; import java.io.ByteArrayInputStream; +import java.io.Console; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; @@ -157,7 +158,15 @@ } while (session == null); if (!session.authAgent(user).await().isSuccess()) { if (password == null) { - password = readLine("Password: "); + Console console = System.console(); + if (console != null) { + char[] readPassword = console.readPassword("Password: "); + if (readPassword != null) { + password = new String(readPassword); + } + } else { + throw new Exception("Could not get system console"); + } } if (!session.authPassword(user, password).await().isSuccess()) { throw new Exception("Authentication failure");