buildroot 登陆及密码问题总结

不知道密码是什么
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::::::::
  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值