if (argv[i].equalsIgnoreCase("-tunnel") || argv[i].equalsIgnoreCase("-via")) {
if (!tunnel.createTunnel(argv.length, argv, i))
System.exit(1);
+ if (argv[i].equalsIgnoreCase("-via")) i++;
continue;
}
String propertiesString = ("\n"+
"\u001B[1mSystem Properties\u001B[0m (adapted from the TurboVNC vncviewer man page)\n"+
" When started with the -via option, vncviewer reads the\n"+
-" \u001B[1mcom.tigervnc.VNC_VIA_CMD\u001B[0m System property, expands\n"+
+" \u001B[1mVNC_VIA_CMD\u001B[0m System property, expands\n"+
" patterns beginning with the \"%\" character, and uses the resulting\n"+
" command line to establish the secure tunnel to the VNC gateway.\n"+
-" If \u001B[1mcom.tigervnc.VNC_VIA_CMD\u001B[0m is not set, this \n"+
+" If \u001B[1mVNC_VIA_CMD\u001B[0m is not set, this \n"+
" command line defaults to \"/usr/bin/ssh -f -L %L:%H:%R %G sleep 20\".\n"+
"\n"+
" The following patterns are recognized in the VNC_VIA_CMD property\n"+
" \t%R remote TCP port number.\n"+
"\n"+
" When started with the -tunnel option, vncviewer reads the\n"+
-" \u001B[1mcom.tigervnc.VNC_TUNNEL_CMD\u001B[0m System property, expands\n"+
+" \u001B[1mVNC_TUNNEL_CMD\u001B[0m System property, expands\n"+
" patterns beginning with the \"%\" character, and uses the resulting\n"+
" command line to establish the secure tunnel to the VNC server.\n"+
-" If \u001B[1mcom.tigervnc.VNC_TUNNEL_CMD\u001B[0m is not set, this command \n"+
+" If \u001B[1mVNC_TUNNEL_CMD\u001B[0m is not set, this command \n"+
" line defaults to \"/usr/bin/ssh -f -L %L:localhost:%R %H sleep 20\".\n"+
"\n"+
" The following patterns are recognized in the VNC_TUNNEL_CMD property\n"+
try {
if (tunnelOption) {
- pattern = System.getProperty("com.tigervnc.VNC_TUNNEL_CMD");
+ pattern = System.getProperty("VNC_TUNNEL_CMD");
} else {
- pattern = System.getProperty("com.tigervnc.VNC_VIA_CMD");
+ pattern = System.getProperty("VNC_VIA_CMD");
}
} catch (java.lang.Exception e) {
vlog.info(e.toString());
}
// username and passphrase will be given via UserInfo interface.
PasswdDialog dlg = new PasswdDialog(new String("SSH Authentication"), false, false);
- dlg.userEntry.setText((String)System.getProperties().get("user.name"));
+ dlg.promptPassword(new String("SSH Authentication"));
Session session=jsch.getSession(dlg.userEntry.getText(), tunnelEndpoint, 22);
- session.setUserInfo(dlg);
+ session.setPassword(new String(dlg.passwdEntry.getPassword()));
session.connect();
String[] tokens = cmd.split("\\s");