Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/rc.d Silence ssh-keygen output when host keys are genera...



details:   https://anonhg.NetBSD.org/src/rev/9a1154a134be
branches:  trunk
changeset: 319320:9a1154a134be
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat May 26 00:17:54 2018 +0000

description:
Silence ssh-keygen output when host keys are generated. Instead, print only
key fingerprints. This replaces dozens of lines out ASCII art output with
something more reasonable:

armv7# service sshd start
ssh-keygen: 1024 SHA256:ynP4BQ2B0Fknnf9PfF4QoUDlYi0+7rNfYXTOYP2cDic root@armv7 (DSA)
ssh-keygen: 521 SHA256:Eoj382aaJNlSxuq/aYj3AXgxfMJAkyVPoCQd2BNjJiA root@armv7 (ECDSA)
ssh-keygen: 256 SHA256:+e9/qTbbN/g6xvkadtHsmIQ+Pc0afZRxbXJsk2HKIzY root@armv7 (ED25519)
ssh-keygen: 2048 SHA256:urNaF/m6oiCe5hXFZBxGLW2PvLz0ibtRFrqYw6R+qTw root@armv7 (RSA)
ssh-keygen: 256 SHA256:Su2Nal2W3vrFz8ukpcSXngl1/bu6xUm1nSvbxTHe9Js root@armv7 (XMSS)
Starting sshd.

diffstat:

 etc/rc.d/sshd |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 4b28d4035915 -r 9a1154a134be etc/rc.d/sshd
--- a/etc/rc.d/sshd     Fri May 25 23:00:34 2018 +0000
+++ b/etc/rc.d/sshd     Sat May 26 00:17:54 2018 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: sshd,v 1.27 2018/04/09 15:02:39 christos Exp $
+# $NetBSD: sshd,v 1.28 2018/05/26 00:17:54 jmcneill Exp $
 #
 
 # PROVIDE: sshd
@@ -30,7 +30,8 @@
                0)      bitarg="${ssh_keygen_flags}";;
                *)      bitarg="-b ${bits}";;
                esac
-               "${keygen}" -t "${type}" ${bitarg} -f "${f}" -N ''
+               "${keygen}" -t "${type}" ${bitarg} -f "${f}" -N '' -q && \
+                   printf "ssh-keygen: " && "${keygen}" -f "${f}" -l
        done << _EOF
 dsa    1024    ssh_host_dsa_key        2       DSA
 ecdsa  521     ssh_host_ecdsa_key      1       ECDSA



Home | Main Index | Thread Index | Old Index