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

Allow simple use of keyboard-interactive authentication #157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshuaspence
Copy link

I am trying to use remote_file with an SSH server configured with:

PasswordAuthentication no
ChallengeResponseAuthentication yes
UsePAM yes

The challenge-response authentication is a simple password prompt, which is equivalent to PasswordAuthentication.

@tenstad tenstad self-requested a review March 19, 2024 09:19
@tenstad
Copy link
Owner

tenstad commented Mar 19, 2024

Hi! Could you try to make this testable in the playground? I tried to use pam pwdfile, but did not get the challange 🤔

FROM ubuntu:latest

COPY key.pub /root/.ssh/authorized_keys

RUN apt-get update && apt-get install -y --no-install-recommends \
    apache2-utils \
    libpam-pwdfile \
    openssh-server \
    sudo \
    && rm -rf /var/lib/apt/lists/* \
    && mkdir /var/run/sshd \
    && ssh-keygen -A \
    && sed -i "s/#\?LogLevel.*/LogLevel DEBUG/" /etc/ssh/sshd_config \
    && sed -i "s/#\?PermitRootLogin.*/PermitRootLogin yes/" /etc/ssh/sshd_config \
    && echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config \
    && echo "ChallengeResponseAuthentication yes" >> /etc/ssh/sshd_config \
    && echo "KbdInteractiveAuthentication yes" >> /etc/ssh/sshd_config \
    && sed -i "/@include common-auth/a auth        required    pam_pwdfile.so pwdfile=/pampwd" /etc/pam.d/sshd \
    && adduser --disabled-password bob \
    && echo "root:password" | chpasswd \
    && htpasswd -cdb /pampwd root password \
    && echo "bob:pwd" | chpasswd \
    && htpasswd -db /pampwd bob pwd \
    && chmod 600 /root/.ssh/authorized_keys

EXPOSE 22
CMD ["/usr/sbin/sshd", "-D", "-E", "/var/log/sshd"]

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

Successfully merging this pull request may close these issues.

2 participants