Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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: http://linux.die.net/man/5/sshd_config

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): https://bugzilla.mindrot.org/show_bug.cgi?id=983

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 this tutorials http://www.howtogeek.com/105413/how-to-compile-and-install-from-source-on-ubuntu/ http://www.howtogeek.com/106526/how-to-resolve-dependencies-while-compiling-software-on-ubuntu/

The result is the same on the 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.

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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.

share|improve this answer
add comment

Just drop password login support and only allow login with keys. Your users can protect the keys with a pass phrase when createing them and that would be as secure.

As it looks as the option you want isn't there for the version of ssh packed, you need to compile the software and manage the security of ssh yourself or wait until the right version are packed. I would wait.

share|improve this answer
    
Hi Anders, thanks for your answer but i finally solved the problem. See Above! –  soerensen May 29 '13 at 15:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.