You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does anyone know if atmoz / sftp support 2 factor authentication with ssh public key and password? if yes, how to associate a ssh public key with an user account? thanks
The text was updated successfully, but these errors were encountered:
Hello,
I am not a maintainer of this repo but I made your request work on my computer by adding this config line AuthenticationMethods "publickey,password"
to the /etc/ssh/sshd_config file and restart the container.
There is currently no option to add it on the fly.
You can create a custom script in /etc/sftp.d that add the line for you in the config.
This script for instance is working if mounted on the container in /etc/sftp.d/forceauth.sh
#!/bin/bash
if [ ! -v AuthenticationMethods ] ; then
AuthenticationMethods="publickey,password"
fi
if [ -z "$(grep AuthenticationMethods /etc/ssh/sshd_config)" ] ; then
echo lol
echo "AuthenticationMethods \"$AuthenticationMethods\"" >> /etc/ssh/sshd_config
else
echo mdr
sed -i "s/AuthenticationMethods .*/AuthenticationMethods \"$AuthenticationMethods\"/" /etc/ssh/sshd_config
fi
With this script in the container, you can even change the AuthenticationMethod with the AuthenticationMethod env var.
Does anyone know if atmoz / sftp support 2 factor authentication with ssh public key and password? if yes, how to associate a ssh public key with an user account? thanks
The text was updated successfully, but these errors were encountered: