60008f9
diff -up openssh-5.6p1/ssh-keygen.0.keygen openssh-5.6p1/ssh-keygen.0
60008f9
--- openssh-5.6p1/ssh-keygen.0.keygen	2010-08-22 16:30:03.000000000 +0200
60008f9
+++ openssh-5.6p1/ssh-keygen.0	2010-08-23 12:37:19.000000000 +0200
60008f9
@@ -4,7 +4,7 @@ NAME
60008f9
      ssh-keygen - authentication key generation, management and conversion
60008f9
 
60008f9
 SYNOPSIS
60008f9
-     ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment]
60008f9
+     ssh-keygen [-q] [-o] [-b bits] -t type [-N new_passphrase] [-C comment]
60008f9
                 [-f output_keyfile]
60008f9
      ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
60008f9
      ssh-keygen -i [-m key_format] [-f input_keyfile]
60008f9
@@ -232,6 +232,8 @@ DESCRIPTION
60008f9
 
60008f9
      -q      Silence ssh-keygen.  Used by /etc/rc when creating a new key.
60008f9
 
60008f9
+     -o      Overwrite the key without prompting user.
60008f9
+
60008f9
      -R hostname
60008f9
              Removes all keys belonging to hostname from a known_hosts file.
60008f9
              This option is useful to delete hashed hosts (see the -H option
60008f9
diff -up openssh-5.6p1/ssh-keygen.1.keygen openssh-5.6p1/ssh-keygen.1
60008f9
--- openssh-5.6p1/ssh-keygen.1.keygen	2010-08-05 05:05:32.000000000 +0200
60008f9
+++ openssh-5.6p1/ssh-keygen.1	2010-08-23 12:36:25.000000000 +0200
60008f9
@@ -47,6 +47,7 @@
60008f9
 .Bk -words
60008f9
 .Nm ssh-keygen
60008f9
 .Op Fl q
60008f9
+.Op Fl o
60008f9
 .Op Fl b Ar bits
60008f9
 .Fl t Ar type
60008f9
 .Op Fl N Ar new_passphrase
60008f9
@@ -397,6 +398,8 @@ Silence
60008f9
 Used by
60008f9
 .Pa /etc/rc
60008f9
 when creating a new key.
60008f9
+.It Fl o
60008f9
+Overwrite the key without prompting user.
60008f9
 .It Fl R Ar hostname
60008f9
 Removes all keys belonging to
60008f9
 .Ar hostname
60008f9
diff -up openssh-5.6p1/ssh-keygen.c.keygen openssh-5.6p1/ssh-keygen.c
60008f9
--- openssh-5.6p1/ssh-keygen.c.keygen	2010-08-05 05:05:32.000000000 +0200
60008f9
+++ openssh-5.6p1/ssh-keygen.c	2010-08-23 12:34:40.000000000 +0200
60008f9
@@ -72,6 +72,7 @@ int change_passphrase = 0;
60008f9
 int change_comment = 0;
60008f9
 
60008f9
 int quiet = 0;
60008f9
+int overwrite = 0;
60008f9
 
60008f9
 int log_level = SYSLOG_LEVEL_INFO;
60008f9
 
60008f9
@@ -1798,7 +1799,7 @@ main(int argc, char **argv)
60008f9
 		exit(1);
60008f9
 	}
60008f9
 
60008f9
-	while ((opt = getopt(argc, argv, "degiqpclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
60008f9
+	while ((opt = getopt(argc, argv, "degiqopclBHLhvxXyF:b:f:t:D:I:P:m:N:n:"
60008f9
 	    "O:C:r:g:R:T:G:M:S:s:a:V:W:z:")) != -1) {
60008f9
 		switch (opt) {
60008f9
 		case 'b':
60008f9
@@ -1878,6 +1879,9 @@ main(int argc, char **argv)
60008f9
 		case 'q':
60008f9
 			quiet = 1;
60008f9
 			break;
60008f9
+		case 'o':
60008f9
+			overwrite = 1;
60008f9
+			break;
60008f9
 		case 'e':
60008f9
 		case 'x':
60008f9
 			/* export key */
60008f9
@@ -2124,7 +2128,7 @@ main(int argc, char **argv)
60008f9
 		}
60008f9
 	}
60008f9
 	/* If the file already exists, ask the user to confirm. */
60008f9
-	if (stat(identity_file, &st) >= 0) {
60008f9
+	if (!overwrite && stat(identity_file, &st) >= 0) {
60008f9
 		char yesno[3];
60008f9
 		printf("%s already exists.\n", identity_file);
60008f9
 		printf("Overwrite (y/n)? ");