Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8.1 #109

Merged
merged 17 commits into from
Feb 10, 2024
Prev Previous commit
Next Next commit
Ag 34 (#103)
fix sshd on ubuntu 22.04
  • Loading branch information
ViktorUJ authored Feb 3, 2024
commit a873cf2b63f8ddde7abc0da29e7417e9635f8949
5 changes: 4 additions & 1 deletion terraform/modules/k8s_self_managment/template/master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
ssh_password_enable_check=${ssh_password_enable}
case $ssh_password_enable_check in
true)
echo -e "${ssh_password}\n${ssh_password}" | passwd ubuntu
echo "ubuntu:${ssh_password}" |sudo chpasswd
SSH_CONFIG_FILE="/etc/ssh/sshd_config"
SSH_CONFIG_FILE_CLOUD="/etc/ssh/sshd_config.d/60-cloudimg-settings.conf"
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' $SSH_CONFIG_FILE
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' $SSH_CONFIG_FILE
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' $SSH_CONFIG_FILE_CLOUD

systemctl restart sshd
;;
*)
Expand Down
6 changes: 5 additions & 1 deletion terraform/modules/work_pc/template/worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@ done

case $ssh_password_enable_check in
true)
echo -e "${ssh_password}\n${ssh_password}" | passwd ubuntu
echo "ubuntu:${ssh_password}" |sudo chpasswd
SSH_CONFIG_FILE="/etc/ssh/sshd_config"
SSH_CONFIG_FILE_CLOUD="/etc/ssh/sshd_config.d/60-cloudimg-settings.conf"
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' $SSH_CONFIG_FILE
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' $SSH_CONFIG_FILE
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' $SSH_CONFIG_FILE_CLOUD

systemctl restart sshd
echo "*** ssh password "
;;
*)
echo "*** ssh password not enable "
Expand Down