mirror of
git://soft.sys114.com/odroid-stamper
synced 2025-12-19 01:48:42 +09:00
firstboot: fix ssh service start issue at first booting
The SSH service fails at first boot due to missing host keys in /etc/ssh even though new host keys are generated using 'ssh-keygen -A' since the service keeps restart too quickly. Therefore new approach is to disable the ssh service when building an image, enable and start it after new host keys are generated in the first boot script. Signed-off-by: Dongjin Kim <tobetter@gmail.com> Change-Id: Idee71e55017e72ec693ddf5e829c27da6343f031
This commit is contained in:
@@ -26,3 +26,5 @@ __EOF
|
||||
|
||||
systemctl enable firstboot.service
|
||||
systemctl disable ondemand
|
||||
|
||||
systemctl disable ssh
|
||||
|
||||
@@ -24,6 +24,8 @@ resize2fs ${rootdev}
|
||||
rm -f /etc/ssh/ssh_host* && ssh-keygen -A
|
||||
|
||||
sed -i "s/PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config
|
||||
service ssh restart
|
||||
|
||||
systemctl enable ssh
|
||||
systemctl restart ssh
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user