SSH As Root in Production

I have a device with two users. root and michael. Over the serial port I can login as either. Over SSH I can only log in as michael. In a production scenario I want to be able to login as root for debug purposes.

I realize the security issues here. Which is why I will ask is it possible to create a user with elevated privilege?

My is as follows. I have also turned off debug tweaks

SUMMARY = “A small image just capable of allowing a device to boot.”

IMAGE_FEATURES += “ssh-server-openssh”

IMAGE_INSTALL = “packagegroup-core-boot ${CORE_IMAGE_EXTRA_INSTALL}”

IMAGE_INSTALL_append = " packagegroup-core-ssh-openssh "
IMAGE_INSTALL_append = " openssh-sftp-server "
IMAGE_INSTALL_append = " can-utils "
IMAGE_INSTALL_append = "



inherit core-image
inherit extrausers

IMAGE_ROOTFS_EXTRA_SPACE_append = “${@bb.utils.contains(“DISTRO_FEATURES”, “systemd”, " + 4096”, “”, d)}"

Change root password (note the capital -P)

usermod -P ‘toor’ root;
useradd -P ‘michael’ michael;


type or paste code here


My recommendation here would be to install “sudo” and after logging in as user “michael”, using “sudo” to change to superuser. You will need to append the sudo recipe to add your user to the /etc/sudoers file.

Alternatively, you can modify the openssh-server package to change the /etc/ssh/sshd_config file (or wherever it is currently stored to enable root login.


@drew.tx This does appear to be the best option for me. Root is only available over a serial port. You can only access the serial port in really bad situations!