Anycloud 调整设备登录输入账号密码
1. 修改默认登陆密码
旧版本SDK默认的登录密码是 anycloudv500
如果需要修改默认的登录密码,则在设备进入命令行后,修改密码:
[root@anyka ~]$ passwd
Changing password for root
New password:
Bad password: too short
Retype password:
passwd: password for root changed by root
修改完成后,将 /etc/config/shadow 拷贝出来,将其放置到SDK的文件系统对应位置:
cp shadow rootfs/resource/etc/config/shadow
然后重新编译文件系统即可.
Note:
烧录时,替换 usr.jffs2、root.sqsh4 两个镜像.
2. 去掉登录账号密码输入
调试时,不想在设备中输入登录账号密码,直接进入命令行,则调整以下配置.
修改 /rootfs/resource/etc/inittab :
1 # /etc/inittab
2
3 # Copyright (C) 2010 Anyka
4
5 # Note: BusyBox init doesn't support runlevels. The runlevels field is
6 # completely ignored by BusyBox init. If you want runlevels, use
7 # sysvinit.
8 #
9 # Format for each entry: <id>:<runlevels>:<action>:<process>
10 #
11 # id == tty to run on, or empty for /dev/console
12 # runlevels == ignored
13 # action == one of sysinit, respawn, askfirst, wait, and once
14 # process == program to run
15
16 # Startup the system
17 ::sysinit:/etc/init.d/rcS
18
19 #ttySAK0::respawn:/sbin/getty -L ttySAK0 115200 vt100 # GENERIC_SERIAL
20 ttySAK0::respawn:/bin/sh
21
22 ::restart:/sbin/init
23 ::ctrlaltdel:/sbin/reboot
24 ::shutdown:/bin/umount -a -r
25 ::shutdown:/sbin/swapoff -a
将配置
ttySAK0::respawn:/sbin/getty -L ttySAK0 115200 vt100 # GENERIC_SERIAL
修改为
ttySAK0::respawn:/bin/sh
然后重新编译文件系统即可.
Note:
烧录时,替换 root.sqsh4 .
3. 去掉登录密码输入
如果只是想去掉密码的输入动作,则调整以下配置.
修改 rootfs/resource/etc/config/passwd :
root:x:0:0:root:/:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
nobody:x:99:99:nobody:/home:/bin/sh
为
root::0:0:root:/:/bin/sh
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
nobody:x:99:99:nobody:/home:/bin/sh
主要将 root:x:0:0:root:/:/bin/sh
去掉其中的 x.
然后重新编译文件系统即可.
Note:
烧录时,替换 usr.jffs2、root.sqsh4 两个镜像.
设备登录时效果如下:
anyka login: root
welcome to file system
[root@anyka ~]$