From ae6fce4f9f57d154efce71b81ad72b413245df15 Mon Sep 17 00:00:00 2001 From: Jeffrey Clark Date: Thu, 8 Feb 2024 11:50:11 -0600 Subject: [PATCH] fix sles ssh setup in docker if ssh already installed --- tasks/docker.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasks/docker.rb b/tasks/docker.rb index 51af675..dac81e1 100755 --- a/tasks/docker.rb +++ b/tasks/docker.rb @@ -41,8 +41,7 @@ def install_ssh_components(distro, version, container) run_local_command("docker exec #{container} ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N \"\"") unless ssh_folder.include?('ssh_host_dsa_key') when %r{opensuse}, %r{sles} run_local_command("docker exec #{container} zypper -n in openssh") - run_local_command("docker exec #{container} ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key") - run_local_command("docker exec #{container} ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key") + run_local_command("docker exec #{container} ssh-keygen -A") run_local_command("docker exec #{container} sed -ri \"s/^#?UsePAM .*/UsePAM no/\" /etc/ssh/sshd_config") when %r{archlinux} run_local_command("docker exec #{container} pacman --noconfirm -Sy archlinux-keyring")