Skip to content

Commit

Permalink
Merge pull request #254 from h0tw1r3/fix-docker-sles
Browse files Browse the repository at this point in the history
fix sles ssh setup in docker if ssh already installed
  • Loading branch information
jordanbreen28 authored Feb 12, 2024
2 parents 4daaa55 + ae6fce4 commit 00f0841
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tasks/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 00f0841

Please sign in to comment.