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

2FA with SFTP #174

Closed
isontheline opened this issue Jan 19, 2021 · 10 comments
Closed

2FA with SFTP #174

isontheline opened this issue Jan 19, 2021 · 10 comments
Assignees
Labels
✨ enhancement New feature or request
Projects
Milestone

Comments

@isontheline
Copy link
Owner

Hello,
You removed the feature on release 13.10 - july 2017 because 2FA never worked with SFTP.
Would you consider to try again to implement this great feature ?
It seems to work but I don't know what was the problem you had ...
https://help.thorntech.com/docs/sftp-gateway-classic/two-factor-authentication-with-google-authenticator/
Thank you very much

Originally posted by @cotchon in #173

@isontheline isontheline self-assigned this Jan 19, 2021
@isontheline isontheline added ✨ enhancement New feature or request ❓ question Further information is requested 📝 reproduce-steps-needed labels Jan 19, 2021
@isontheline isontheline added this to the 14.10 - Truck milestone Jan 19, 2021
@isontheline
Copy link
Owner Author

@cotchon

I'm searching on the Internet but the use of 2FA with SFTP isn't as "easy" as I would like :

Could you share your SFTP configuration and your actual SFTP client used ?

@isontheline isontheline modified the milestones: 14.10 - Truck, 15.0 Jan 19, 2021
@cotchon
Copy link

cotchon commented Jan 20, 2021

Hello,
Actually I tried with SFTP cli from High Sierra and it worked with 2FA, after login asked me for the code. I don't know which SFTP client it is (no version)
I've just tried with Cyberduck, Version 7.6.2 (33520), it worked also
I've just tried also with Filezilla, Version 3.50.0, it worked, authentication type interactive
It seems to be difficult since I read your links #24 and #288 to get prompted correctly when 2FA occurs...
Hope this helps.

@cotchon
Copy link

cotchon commented Jan 20, 2021

sshd_config
ChallengeResponseAuthentication yes

PAM configuration for the Secure Shell service
@include common-auth
auth required pam_google_authenticator.so nullok

From webssh I get on my device :
Jan 20 10:10:43 PI4B sshd(pam_google_authenticator)[749]: Invalid verification code for pi
Jan 20 10:10:46 PI4B sshd[749]: Failed password for pi from x.x.x.x port 63774 ssh2

From Filezilla, I get 1st prompt for password, then second prompt for the code,
on my device, i get :
Jan 20 10:14:38 PI4B sshd(pam_google_authenticator)[759]: Accepted google_authenticator for pi
Jan 20 10:14:39 PI4B sshd[757]: Accepted keyboard-interactive/pam for pi from x.x.x.x port 60936 ssh2
Jan 20 10:14:39 PI4B sshd[757]: pam_unix(sshd:session): session opened for user pi by (uid=0)
Jan 20 10:14:39 PI4B systemd-logind[554]: New session 153 of user pi.

@isontheline
Copy link
Owner Author

Thank you a lot for your feedback @cotchon !

I will try to figure out why I didn't success SFTP 2FA connections in the past

@isontheline isontheline removed ❓ question Further information is requested 📝 reproduce-steps-needed labels Jan 20, 2021
@isontheline isontheline modified the milestones: 15.0, 14.10 - Truck Jan 23, 2021
@isontheline
Copy link
Owner Author

Hello @cotchon 👋

It seems possible to implement 2FA over SFTP but only if an SSH connection is launched in background.

I don't think it will cause any problem in most case as the SSH connection will only be opened on the channel side and no shell would be opened at all.

@cotchon
Copy link

cotchon commented Feb 3, 2021

That's a great news :-)

@isontheline isontheline modified the milestones: 14.10 - Truck, 15.0 Feb 11, 2021
@isontheline isontheline modified the milestones: 15.0, 14.20 - Cactus Jun 24, 2021
@isontheline
Copy link
Owner Author

@cotchon Work In Progress

@isontheline
Copy link
Owner Author

Hello @cotchon 👋

Could you try WebSSH 14.20 please?
https://testflight.apple.com/join/QSrBK59z

@cotchon
Copy link

cotchon commented Jul 6, 2021

You did it man !!! It works great :-)

THANK YOU VERY MUCH

Now I have a good security enabled at home + webssh which rocks !!!

I use pubkey+2FA to get into my system

For thoses interested : https://www.techrepublic.com/article/how-to-combine-ssh-key-authentication-and-two-factor-authentication-on-linux/

@isontheline
Copy link
Owner Author

Thank you a lot for your feedback @cotchon 🙏

Glad to see that this feature made your day 😇

Repository owner deleted a comment from EID0o02012 Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
No open projects
SFTP
Awaiting triage
Development

No branches or pull requests

2 participants