'Yocto is giving root a password
I am using Yocto to create a linux image for an iMX6. I am using Yet Another Terminal (YAT) and Command Line to interface with the device image. I added
inherit extrausers
ROOTPASSWORD = "root"
ROOTUSERNAME = "root"
EXTRA_USERS_PARAMS = "usermod -P ${ROOTPASSWORD} ${ROOTUSERNAME};"
To core-image-full-cmdline.bb
Using YAT this password takes hold. However using the terminal I can not SSH into my device. Using
ssh [email protected]
This should log in automatically as Yocto does not set a default password. When I enter root as the password I am not logged in.
Solution 1:[1]
By default Yocto configures SSH servers to prevent root logins. I'll skip the reasons why that's a good idea, but you have a few options.
- Create a non-root user, SSH with that then
suusing your root password.
EXTRA_USERS_PARAMS = " \
useradd -P ssh_password ssh_user; \
usermod -P root_password root; \
"
- Configure your SSH server to allow root logins.
- Dropbear: add a bbappend to modify
dropbear.defaultremoving-wfrom the args - OpenSSH: add a bbappend to modify
sshd_configaddingPermitRootLogin prohibit-passwordto allow certificate logins orPermitRootLogin yesto allow password logins.
- Dropbear: add a bbappend to modify
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Eric Haskins |
