Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
B #223: Mask ssh service during dpkg-reconfigure openssh-server
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlastimil Holer committed Mar 26, 2021
1 parent bb2df2a commit de49ba5
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/etc/one-context.d/loc-24-ssh_host_key##deb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,32 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #

SERVICE_FILE='/etc/systemd/system/ssh.service'
SERVICE_LINK='/dev/null-one-context'

setup() {
if [ -d "$(dirname "${SERVICE_FILE}")" ] &&
! stat "${SERVICE_FILE}" &>/dev/null;
then
ln -s "${SERVICE_LINK}" "${SERVICE_FILE}"
fi
}

clean() {
if [ -L "${SERVICE_FILE}" ] &&
[ "$(readlink "${SERVICE_FILE}")" = "${SERVICE_LINK}" ];
then
unlink "${SERVICE_FILE}"
systemctl daemon-reload &>/dev/null || :
fi
}

###

trap 'clean' EXIT

if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
setup

DEBIAN_FRONTEND=noninteractive dpkg-reconfigure openssh-server
fi

1 comment on commit de49ba5

@GitCop
Copy link

@GitCop GitCop commented on de49ba5 Mar 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There were the following issues with your Pull Request

  • Subject must be equal or less than 50

Guidelines are available at https://github.com/OpenNebula/one/blob/master/share/doc/dev/COMMIT_MESSAGES.md


This message was auto-generated by https://gitcop.com

Please sign in to comment.