Transplantation and use of SSH

SSH can be obtained from builderoot:

# cd buildroot-2020.05/
# ARCH=arm make menuconfig

# cp .config ./configs/ssd20x_defconfig -f
# make BR2_JLEVEL=4
# cp ./output/images/rootfs.tar ../project/image/rootfs/rootfs.tar -f
# cd ../project/image/rootfs
# rm rootfs/* -rf
# tar -xvf rootfs.tar -C ./rootfs/
# tar -cvf rootfs.tar.gz ./rootfs
# cd ../../../

Recompile firmware and update rootfs:

# ./Release_to_customer.sh -f nand -p ssd201 -o 2D06

After the system starts, it is found that SSH does not start automatically:

# ps | grep ssh

Manual start failed:

# /etc/init.d/S50sshd start

Permission to modify /var/empty:

# chown root:root /var/empty
# /etc/init.d/S50sshd start

Set the following account and password for root:

# passwd root

Open root login permission:

# vi /etc/ssh/sshd_config

Restart sshd:

# /etc/init.d/S50sshd restart    

verification:

After successful login, it is found that some device nodes of /dev/ are missing:

# ls /dev/mi*

After checking, it is caused by the repeated execution of “mount -t tmpfs mdev /dev” in /etc/profile. Therefore, I put the actions I don’t want to repeat into /etc/init.d/rcs:

# vi /etc/profile

# vi /etc/init.d/rcS

After this modification, the device node still exists normally through SSH login:

Complete the above modifications in the SDK.
First, the related contents of profile and RCS:

# vi project/image/configs/i2m/rootfs.mk

Then /var/empty and sshd_config related contents:

# vi project/image/configs/i2m/rootfs.mk
 + sed -i 's/\#PermitRootLogin prohibit-password/PermitRootLogin yes/' $(OUTPUTDIR)/rootfs/etc/ssh/sshd_config

# cp project/image/output/rootfs/etc/init.d/S50sshd  project/image/rootfs_add_files/etc/init.d/
# vi project/image/rootfs_add_files/etc/init.d/S50sshd
+ chown root:root /var/empty

Finally, the default account and password. The related files are /etc/shadow and /etc/passwd. Copy them from the development board with the password configured:

# ls -l project/image/rootfs_add_files/etc/shadow*
# ls -l project/image/rootfs_add_files/etc/passwd*

Recompile firmware and update rootfs:

# ./Release_to_customer.sh -f nand -p ssd201 -o 2D06

After the system is started, log in with root (password 123456) successfully:

I copy the modified relevant files to IDO-SSD20X/IDO-SBC2D70/开发文档/ssh/.

文档更新时间: 2021-07-30 16:07   作者:Aeeditor