Monday, April 29, 2024
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 6678  / 1 Year ago, thu, december 8, 2022, 10:16:08

I'm using Ubuntu Server 13.04 and want to use OpenSSH for sftp.
I have everything set up and the only thing not working is the Two Factor Authentication.
Currently it asks for a password or the public key but I need it to ask for a password AND a public key.



It seams that there is a parameter in the sshd_config for that:



RequiredAuthentications{1,2} 


It is listed here: linux.die.net



So I added this line to the /etc/sshd_config



RequiredAuthentications2 publickey,password


But sshd -t would always give this error



/etc/ssh/sshd_config: line 26: Bad configuration option: RequiredAuthentications2


My version of OpenSSH is 6.1.p1-4.
From this post I figured that it is only available in openssh-6.2:
(The last post): bugzilla.mindrot.org



To test this on another computer with Linux Mint i tried to compile this version from source as it is not available for Ubuntu stable.



I did this using auto-apt as suggested in these tutorials

www.howtogeek.com -1

www.howtogeek.com -2



The result is the same on the Linux Mint Computer.



So I'm stuck for the moment.



P.S.: Somewhere else I found you could use a second authentication script but I'm not sure if this is a good and secure solution. I want to use the server with normal ftp programs like WinSCP or Filezilla from Windows. I don't know if they would understand that way of authentication.


More From » authentication

 Answers
2

I was finally able to solve the problem.



Since version 6.2 of opensshd there is in fact a parameter for 2 factor authentication. Instead of RequiredAuthentications it's AuthenticationMethods. The parameters for that are the same.



As there is no deb package in Ubuntu for version 6.2 you have to compile it yourself but with auto-apt it's really easy.


[#31021] Thursday, December 8, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terose

Total Points: 185
Total Questions: 125
Total Answers: 131

Location: Venezuela
Member since Mon, Dec 13, 2021
2 Years ago
terose questions
;