Description
Add a configuration variable in local.conf that can disable SSH root login for security purposes. This should be a build-time option that allows users to create more secure production images.
Requirements
- Add an environment variable (e.g.,
EDGEOS_DISABLE_ROOT_SSH) in local.conf
- When enabled, prevent
ssh root@edgeos-device.local access
- Should still allow non-root user SSH access if configured
- Must be configurable at build time, not runtime
Suggested Implementation
-
Add to local.conf.sample:
# Disable root SSH access (0 = allow, 1 = disable)
# EDGEOS_DISABLE_ROOT_SSH = "1"
-
Create OpenSSH bbappend:
# meta-edgeos/recipes-connectivity/openssh/openssh_%.bbappend
do_install:append() {
if [ "${EDGEOS_DISABLE_ROOT_SSH}" = "1" ]; then
sed -i 's/^#*PermitRootLogin.*/PermitRootLogin no/' ${D}${sysconfdir}/ssh/sshd_config
fi
}
-
Alternative: Manage via edgeos-user recipe
- Configure SSH settings based on the variable
- Potentially create alternative admin user when root is disabled
Security Considerations
- Document that disabling root SSH requires alternative access method
- Consider requiring creation of admin user when root SSH is disabled
- Ensure serial console access remains available for recovery
Acceptance Criteria
Description
Add a configuration variable in
local.confthat can disable SSH root login for security purposes. This should be a build-time option that allows users to create more secure production images.Requirements
EDGEOS_DISABLE_ROOT_SSH) in local.confssh root@edgeos-device.localaccessSuggested Implementation
Add to local.conf.sample:
Create OpenSSH bbappend:
Alternative: Manage via edgeos-user recipe
Security Considerations
Acceptance Criteria