允许 root 远程登录

This commit is contained in:
Wildlife 2020-08-11 14:48:58 +08:00
parent 1cc0ec05f0
commit ba18b30b2a
3 changed files with 10 additions and 2 deletions

5
.gitignore vendored
View File

@ -1,3 +1,8 @@
bin
out
tmp
linux
u-boot
rkbin
kernel
arm-trusted-firmware

View File

@ -110,7 +110,7 @@ build_rootfs() {
# 创建 2G 空白文件,具体所需大小根据 sudo du -h --max-depth=0 "$ROOTFS_PATH" 调整
dd if=/dev/zero of="$ROOTFS_IMAGE" bs=1M count=2048 oflag=sync status=progress
# 格式化为 ext4 分区
mkfs.ext4 "$ROOTFS_IMAGE"
mkfs.ext4 -F -L rootfs "$ROOTFS_IMAGE"
# 复制 rootfs 文件到镜像
mount "$ROOTFS_IMAGE" /mnt

View File

@ -37,8 +37,11 @@ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 更新软件包
apt update && apt dist-upgrade -y
# 允许 root 远程登录
echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
# 修改默认密码
echo "root:1234" | chpasswd
echo 'root:1234' | chpasswd
# 设置密码过期
chage -d 0 root