+Fri Sep 21 16:22:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
+
+ * src/remote_internal.c: Add a no_tty flag to stop SSH prompting
+ for passwords on console
+ * docs/libvir.html, docs/remote.html: Document no_tty flag
+
Fri Sep 21 15:06:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
* acinclude.m4: Check all compiler flags link successfully
<td> Example: <code>no_verify=1</code> </td>
</tr>
+<tr>
+<td> <code>no_tty</code> </td>
+<td> ssh </td>
+<td>
+ If set to a non-zero value, this stops ssh from asking for
+ a password if it cannot log in to the remote machine automatically
+ (eg. using ssh-agent etc.). Use this when you don't have access
+ to a terminal - for example in graphical programs which use libvirt.
+</td>
+</tr>
+<tr> <td colspan="2"></td>
+<td> Example: <code>no_tty=1</code> </td>
+</tr>
+
</table>
<h3><a name="Remote_certificates">Generating TLS certificates</a></h3>
</td>
</tr><tr><td colspan="2"></td>
<td> Example: <code>no_verify=1</code> </td>
+</tr><tr><td> <code>no_tty</code> </td>
+<td> ssh </td>
+<td>
+ If set to a non-zero value, this stops ssh from asking for
+ a password if it cannot log in to the remote machine automatically
+ (eg. using ssh-agent etc.). Use this when you don't have access
+ to a terminal - for example in graphical programs which use libvirt.
+</td>
+</tr><tr><td colspan="2"></td>
+<td> Example: <code>no_tty=1</code> </td>
</tr></table><h3><a name="Remote_certificates" id="Remote_certificates">Generating TLS certificates</a></h3><h4><a name="Remote_PKI" id="Remote_PKI">Public Key Infrastructure set up</a></h4><p>
If you are unsure how to create TLS certificates, skip to the
next section.
*/
char *name = 0, *command = 0, *sockname = 0, *netcat = 0, *username = 0;
char *server = 0, *port = 0;
- int no_verify = 0;
+ int no_verify = 0, no_tty = 0;
char **cmd_argv = 0;
/* Return code from this function, and the private data. */
} else if (strcasecmp (var->name, "no_verify") == 0) {
no_verify = atoi (var->value);
var->ignore = 1;
+ } else if (strcasecmp (var->name, "no_tty") == 0) {
+ no_tty = atoi (var->value);
+ var->ignore = 1;
}
#if DEBUG
else
}
case trans_ssh: {
- int j, nr_args = username ? 10 : 8;
+ int j, nr_args = 8;
+
+ if (username) nr_args += 2; /* For -l username */
+ if (no_tty) nr_args += 5; /* For -T -o BatchMode=yes -e none */
command = command ? : strdup ("ssh");
cmd_argv[j++] = strdup ("-l");
cmd_argv[j++] = strdup (username);
}
+ if (no_tty) {
+ cmd_argv[j++] = strdup ("-T");
+ cmd_argv[j++] = strdup ("-o");
+ cmd_argv[j++] = strdup ("BatchMode=yes");
+ cmd_argv[j++] = strdup ("-e");
+ cmd_argv[j++] = strdup ("none");
+ }
cmd_argv[j++] = strdup (server);
cmd_argv[j++] = strdup (netcat ? netcat : "nc");
cmd_argv[j++] = strdup ("-U");