Symptom
Devices running Fuji-16.9.1 or Fuji-16.9.2 or Gibraltar-16.10.1 code is configured with minimal configuration for SSH access
under certain circumstances it is possible that RSA keys for SSH access will not be saved in persistent storage which will result in SSH access being lost upon reload/power cycle etc.
[BAD] scenario 1: "do write" is issued from within config mode and keys are not saved
[GOOD] scenario 2: "write" is issued from privileged mode and keys are saved as desired
[GOOD] scenario 3: "do copy running-config startup-config" is issued from within config mode and keys are saved as desired
[GOOD] scenario 4: "copy running-config startup-config" is issued from privileged mode and keys are saved as desired
Conditions
this occurs when configuration is saved from withing configuration mode using "do write" command
Workaround
use different commands to save configuration
if it is necessary to save configuration from within configuration mode then use "do copy running-config startup-config" command
otherwise use either "copy running-config startup-config" command or "write" command from privileged mode
Further Problem Description
this can be verified by checking nvram:private-config file size
if this is too small [couple bytes to a few hundred bytes] indicates that RSA keys are not saved
if it is larger [couple kilobytes, depending on RSA key size] indicates that RSA keys are saved