不知道密码是什么
BR2_TARGET_ENABLE_ROOT_LOGIN=y
BR2_TARGET_GENERIC_ROOT_PASSWD="root"
root 账户的 密码是root
此时 /etc/shadow 中 内容如下
root:$5$yZPH77cf8TH.Qb$0pFfcLjCrlStmZTjFYop9K3yhQfr5BprSlBF6pPXSJ2:::::::
登陆不进去,显示 login: bad salt
Welcome to Buildroot
buildroot login: root
Password:
login: bad salt
BR2_TARGET_ENABLE_ROOT_LOGIN=n , 应该是 y
登陆不进去,显示 Login incorrect
Welcome to Buildroot
buildroot login: user
Password:
Login incorrect
- 解决方案1
将/etc/shadow 中的
root::::::::
改为
root::0::::::
- 解决方案2
如果你在 busybox 中配置有 CONFIG_USE_BB_SHADOW=y // BB : BusyBox // 意思是如果你不用busybox中的功能,你需要编译额外的代码来实现这个功能
那么会导致 buildroot 不能依靠 用户名(root)和密码(root)的方式登陆
所以你需要显示配置 CONFIG_USE_BB_SHADOW=n
猜测
CONFIG_USE_BB_SHADOW=y 可解析 root::0:::::: , 不能解析 root::::::::
CONFIG_USE_BB_SHADOW=n 可解析 root:::::::: 和 root::0::::::
│ CONFIG_USE_BB_PWD_GRP: │
│ │
│ If you leave this disabled, busybox will use the system's password │
│ and group functions. And if you are using the GNU C library │
│ (glibc), you will then need to install the /etc/nsswitch.conf │
│ configuration file and the required /lib/libnss_* libraries in │
│ order for the password and group functions to work. This generally │
│ makes your embedded system quite a bit larger. │
│ │
│ Enabling this option will cause busybox to directly access the │
│ system's /etc/password, /etc/group files (and your system will be │
│ smaller, and I will get fewer emails asking about how glibc NSS │
│ works). When this option is enabled, you will not be able to use │
│ PAM to access remote LDAP password servers and whatnot. And if you │
│ want hostname resolution to work with glibc, you still need the │
│ /lib/libnss_* libraries. │
│ │
│ If you need to use glibc's nsswitch.conf mechanism │
│ (e.g. if user/group database is NOT stored in /etc/passwd etc), │
│ you must NOT use this option. │
│ │
│ If you enable this option, it will add about 1.5k. │
│ │
│ Symbol: USE_BB_PWD_GRP [=y] │
│ Prompt: Use internal password and group functions rather than system functions │
│ Defined at loginutils/Config.in:17 │
│ Location: │
│ -> Login/Password Management Utilities
如何免密码
BR2_TARGET_ENABLE_ROOT_LOGIN=y
BR2_TARGET_GENERIC_ROOT_PASSWD=""
此时 /etc/shadow 中 内容如下
root::::::::
$ cat /etc/passwd
root:x:0:0:root:/root:/bin/sh
$ cat /etc/shadow
root::::::::