Skip to content

Commit

Permalink
Fix problem with disabled SSH password login
Browse files Browse the repository at this point in the history
As this problem appeared on Tumbleweed where the new directory
`/etc/ssh/sshd_config.d/` is in place I'm checking for it.
  • Loading branch information
pdostal committed Jun 20, 2021
1 parent 739487a commit 46a6675
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/network/setup_multimachine.pm
Expand Up @@ -17,7 +17,7 @@ use testapi;
use lockapi;
use mm_network 'setup_static_mm_network';
use utils 'zypper_call';
use Utils::Systemd 'disable_and_stop_service';
use Utils::Systemd qw(disable_and_stop_service systemctl);
use version_utils qw(is_sle is_opensuse);

sub is_networkmanager {
Expand Down Expand Up @@ -60,14 +60,22 @@ sub run {
assert_script_run "nmcli connection up '$nm_id'";
}
else {
assert_script_run 'systemctl restart wicked';
systemctl("restart wicked");
}
}

# Set the hostname to identify both minions
assert_script_run "hostnamectl set-hostname $hostname";
assert_script_run "hostnamectl status|grep $hostname";
assert_script_run "hostname|grep $hostname";

# Make sure that PermitRootLogin is set to yes
# This is needed only when the new SSH config directory exists
# See: poo#93850
if (script_run("test -d /etc/ssh/sshd_config.d") == 0) {
assert_script_run "echo 'PermitRootLogin yes' > /etc/ssh/sshd_config.d/PermitRootLogin.conf";
systemctl("restart sshd");
}
}

1;
Expand Down

0 comments on commit 46a6675

Please sign in to comment.