I add this to many of my build scripts... It might be handy to include this scripted prompt for Ubuntu users. (For some reason formatted code wont paste properly in full)
source /etc/os-release
if [[ $VERSION_ID > "22" && $NAME = "Ubuntu" ]] ; then
while true; do
echo
echo -e "Ubuntu SSH public key configuration.."
echo
echo -e "Ubuntu 22.X and above removed default support for RSA formatted SSH public keys."
echo
read -p 'Restore Ubuntu support for RSA SSH public keys now? yes/no: ' INPUT
case $INPUT in
[yY]*)
sed -i '$ a PubkeyAcceptedKeyTypes +ssh-rsa' /etc/ssh/sshd_config
service ssh restart
echo
break
;;
[nN]*)
echo
echo -e "$Ubuntu SSH public key configuration not updated."
echo
break
;;
*)
echo 'Invalid input' >&2
esac
Suggestion:
I add this to many of my build scripts... It might be handy to include this scripted prompt for Ubuntu users. (For some reason formatted code wont paste properly in full)
source /etc/os-release if [[ $VERSION_ID > "22" && $NAME = "Ubuntu" ]] ; then
done fi