主题 : 如何实现嵌入式linux的登录密码? 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 23590
精华: 0
发帖: 1
金钱: 5 两
威望: 1 点
综合积分: 2 分
注册时间: 2010-06-22
最后登录: 2010-09-01
楼主  发表于: 2010-08-26 08:57

 如何实现嵌入式linux的登录密码?

移植了内核和跟文件系统,直接回车,就进入了linux 命令行,如何设置进入命令行的密码和用户名?在此跪谢了,
自由,自强,共享,共创。
级别: 论坛版主
UID: 12573
精华: 27
发帖: 8838
金钱: 46490 两
威望: 9298 点
综合积分: 18216 分
注册时间: 2010-01-09
最后登录: 2019-07-16
1楼  发表于: 2010-08-26 10:28
以single用户级别登陆是不需要密码的,设置了也没有用.
新手如何向我们反馈有效的信息,以便解决问题,见此贴:
http://www.arm9home.net/read.php?tid-14431.html

[注]: 此处签名链接仅为指引方向,而非解答问题本身.
级别: 新手上路
UID: 18749
精华: 0
发帖: 16
金钱: 100 两
威望: 20 点
综合积分: 32 分
注册时间: 2010-04-12
最后登录: 2010-10-23
2楼  发表于: 2010-08-26 20:05
把runlevel改成多用户还是不行?
级别: 新手上路
UID: 50628
精华: 0
发帖: 18
金钱: 95 两
威望: 19 点
综合积分: 36 分
注册时间: 2011-06-24
最后登录: 2011-09-23
3楼  发表于: 2011-09-03 17:12
楼主,这个问题我也遇到了,现在解决了。步骤如下:
1、重新编译busybox。
输入命令
#make menuconfig
在菜单的 Login/Password Management Utilities  --->  下按照如下选择:
[*] Support for shadow passwords
[*] Use internal password and group functions rather than system functions
[*]   Use internal shadow password functions
[*] Use internal crypt functions
[*]   Enable SHA256/512 crypt functions
[*] addgroup
[*]   Enable long options
[*]   Support for adding users to groups
[*] delgroup
[*]   Support for removing users from groups
[ ] Enable sanity check on user/group names in adduser and addgroup
[*] adduser
[ ]   Enable long options
(100) First valid system uid or gid for adduser and addgroup
(999) Last valid system uid or gid for adduser and addgroup
[*] deluser
[*] getty
[*] login
[ ]   Support for PAM (Pluggable Authentication Modules)
[*]   Support for login scripts
[*]   Support for /etc/nologin
[*]   Support for /etc/securetty
[*] passwd              
[*]   Check new passwords for weakness
[*] cryptpw
[*] chpasswd  
[*] su
[*]   Enable su to write to syslog  
[*]   Enable su to check user's shell to be listed in /etc/shells  
[*] sulogin  
[*] vlock        

2、拷贝三个文件 passwd shadow inittab 到 /etc 下
passwd 与 shadow 文件就不说了, inittab 文件内容如下
# /etc/inittab

# The default runlevel is defined here
#:3:initdefault:

# System initialization.
::sysinit:/etc/init.d/rcS
#1:2345:respawn:/sbin/getty 115200 tty1
#2:2345:respawn:/sbin/getty 115200 tty2
#3:2345:respawn:/sbin/getty 115200 tty3
#4:2345:respawn:/sbin/getty 115200 tty4
#5:2345:respawn:/sbin/getty 115200 tty5
#6:2345:respawn:/sbin/getty 115200 tty6

# Put a getty on the serial line (for a terminal)
# uncomment this line if your using a serial console
#:2345:respawn:/sbin/getty -L s3c2410_serial0 115200 vt100
:2345:respawn:/sbin/getty -L ttySAC0 115200 vt100
#::askfirst:-/bin/sh

:12345:ctrlaltdel:/sbin/reboot