Skip to content

Commit

Permalink
Work around broken SSH login by disabling PAM for Fedora and Oracle (#82
Browse files Browse the repository at this point in the history
)

* Change: Disable PAM for Oracle to work around broken SSH login

* Change: Disable PAM for Fedora to work around broken SSH login
  • Loading branch information
n-thumann authored Jan 21, 2025
1 parent 3caf6cd commit 821cdbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion operating_systems/fedora/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ RUN if [ "$UPDATED" = true ]; then dnf upgrade -y; fi \
&& echo "demo:demo" | chpasswd \
&& ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N "" \
&& ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N "" \
&& ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N ""
&& ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "" \
# Workaround to fix SSH login (see VTA-641)
&& echo "UsePAM no" > /etc/ssh/sshd_config.d/01-disable-usepam.conf

CMD [ "/usr/sbin/sshd", "-D" ]

Expand Down
5 changes: 4 additions & 1 deletion operating_systems/oraclelinux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ RUN if [ "$UPDATED" = true ]; then yum upgrade -y && yum clean all; fi \
&& echo "demo" | passwd --stdin demo \
&& ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N "" \
&& (ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N "" || true) \
&& (ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "" || true)
&& (ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key -N "" || true) \
# Workaround to fix SSH login (see VTA-641)
&& if [ -d /etc/ssh/sshd_config.d ]; then echo "UsePAM no" > /etc/ssh/sshd_config.d/01-disable-usepam.conf; \
else sed -i "s/UsePAM yes/UsePAM no/" /etc/ssh/sshd_config; fi

CMD [ "/usr/sbin/sshd", "-D" ]

Expand Down

0 comments on commit 821cdbe

Please sign in to comment.