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

добавить в yc-image-cleanup.sh -с возможность выставления PasswordAuthentication в no #205

Open
dmitry-j-mikhin opened this issue Aug 9, 2023 · 1 comment

Comments

@dmitry-j-mikhin
Copy link

Сейчас yc-image-cleanup.sh -d проверяет, выставлена ли переменная PasswordAuthentication в конфиге sshd в значение no. Но нет кода который бы это мог бы сделать такое выставление автоматом. Нужно сделать по аналогии со сбросом PermitRootLogin:

function changeSSHRootLoginToDefault {
OS_TYPE=$(getOS)
if [ "$OS_TYPE" == "FreeBSD" ]; then
sed -i.bak "s/#*.PermitRootLogin.*/PermitRootLogin no/" /etc/ssh/sshd_config
rm -f /etc/ssh/sshd_config.bak
else
sed -i 's/.*PermitRootLogin.*/#PermitRootLogin No/g' /etc/ssh/sshd_config
echo "DONE"
fi
}

@dmitry-j-mikhin
Copy link
Author

PR - #206

dmitry-j-mikhin added a commit to dmitry-j-mikhin/yc-examples that referenced this issue Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant