Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfeb3d1

Browse files
committed
Add workaround and logging to ssh key generation, fixes guysoft#424
1 parent 23fafdf commit dfeb3d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/modules/octopi/start_chroot_script

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ systemctl_if_exists enable check_wpa_link.service
186186
### Fix SSH
187187
echo "IPQoS 0x00" >> /etc/ssh/sshd_config
188188

189+
190+
### Try and fix https://github.com/guysoft/OctoPi/issues/424
191+
192+
sed -i "s@ExecStart=/usr/bin/ssh-keygen -A -v@ExecStart=/bin/bash -c ' /usr/bin/ssh-keygen -A -v >> /var/log/regenerate_ssh_host_keys.log 2>\&1'@g" /lib/systemd/system/regenerate_ssh_host_keys.service
193+
sed -i "s@ExecStartPost=/bin/systemctl disable regenerate_ssh_host_keys@ExecStartPost=/bin/bash -c 'for i in /etc/ssh/ssh_host_*_key*; do actualsize=\$(wc -c <\"\$i\") ;if [ \$actualsize -eq 0 ]; then echo size is 0 bytes ; exit 1 ; fi ; done ; /bin/systemctl disable regenerate_ssh_host_keys'@g" /lib/systemd/system/regenerate_ssh_host_keys.service
194+
189195
### OctoPrint
190196

191197
if [ "$OCTOPI_INCLUDE_OCTOPRINT" == "yes" ]

0 commit comments

Comments
 (0)