5542N/A# Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. 5542N/A# Checks to see if RSA, and DSA host keys are available 5542N/A# if any of these keys are not present, the respective keys are created. 5542N/A # HostKey keywords in sshd_config may be preceded or 5542N/A # followed by a mix of any number of space or tabs, 5542N/A # and optionally have an = between keyword and 5542N/A # argument. We use two grep invocations such that we 5542N/A # can match HostKey case insensitively but still have 5542N/A # the case of the path name be significant, keeping 5542N/A # the pattern somewhat more readable. 5542N/A # The character classes below contain one literal 5542N/A # space and one literal tab. 5542N/A# This used to be part of default SunSSH sshd_config and instructed SunSSH 5542N/A# to listen on all interfaces. For OpenSSH, the same line means listen on all 5542N/A# Historically default sshd_config was shipped with 'ListenAddress ::',\n\ 5542N/A# which means 'listen on all interfaces' in SunSSH.\n\ 5542N/A# In OpenSSH this setting means 'listen on all IPv6 interfaces'.\n\ 5542N/A# To avoid loss of service after transitioning to OpenSSH, the following\n\ 5542N/A'ListenAddress ::', which means 'listen on all interfaces' in SunSSH. \ 5542N/AIn OpenSSH this setting means 'listen on all IPv6 interfaces'. \ 5542N/AFor both SunSSH and OpenSSH the default behavior when no ListenAddress \ 5542N/Ais specified is to listen on all interfaces (both IPv4 and IPv6)." 5542N/A$SSHDIR/sshd_config, the file will not be modified. Please, check your \ 5542N/A # only modify sshd_config, if ssh implementation is OpenSSH 5542N/A # comment '# IPv4 & IPv6' indicates an old default sshd_config 5542N/A # if 'ListenAddress ::' is the only ListenAddress line, comment it out 5542N/A !/^# IPv4 & IPv6$/ {print}" 5542N/A # no ListenAddress setting => OK, silently remove comment 5542N/A # send warning message both to log and console 5542N/A echo "Update error! Check your ListenAddress settings." 5542N/A # write the fixed content to the file 5542N/A# This script is being used for two purposes: as part of an SMF 5542N/A # sysconfig unconfigure to remove the sshd host keys 5542N/A # SMF arguments (start and restart [really "refresh"]) 5542N/A # If host keys don't exist when the service is started, create 5542N/A # them; sysidconfig is not run in every situation (such as on 5542N/A echo "Usage: $0 { start | restart }"