Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to host stuff for a financial institution on EC2. The bank wants complete Two Factor Authentication so Stuff like having SSH with a key with password. Something like SecureID or similar would be great. How can I effectively create two factor authentication across SSH to my EC2 environment?

Also could I consider OpenVPN as part of the Two Factor encyption?

share|improve this question

4 Answers

You will need to secure access to the EC2 console with two-factor. There you are at the mercy of Amazon. For SSH access, you can do lots of options. You can do SSH keys and require that the keys have a password. However, note that there is nothing to keep someone from writing an SSH client that lies about the cert having a password. SSH is great from a security PoV, but it doesn't always pass muster for regulatory requirements. For example, the keys might need to be re-generated periodically. SSH doesn't support that.

PAM radius is your friend if you decide to use a two-factor auth system: http://www.wikidsystems.com/support/wikid-support-center/how-to/pam-radius-how-to

hth,

share|improve this answer

Two-factor authentication similar to SecurID is readily available via AWS Identity and Access Management (IAM) by means of the AWS Multi-Factor Authentication. Whether this actually applies to your question depends on your particular use case though, i.e. what scenarios you need to protect with two-factor authentication (e.g. the mentioned SSH access vs. AWS Management Console access vs. access to websites you host on EC2 in return etc.).

Specifically, IAM covers access to the AWS Management Console but obviously not SSH, in addition EC2 is one of the AWS products, where IAM does not apply at the resource level, rather only at the service level, see Integrating with Other AWS Products and Using AWS Identity and Access Management with EC2, especially the following disclaimer:

Important

Amazon EC2 uses SSH keys, Windows passwords, and security groups to control who has access to specific Amazon EC2 instances. You can't use the IAM system to allow or deny access to a specific instance.

Please note that IAM usage is highly recommended for anything AWS regardless of multifactor-authentication.

Finally I'd like to highlight two more recent additions to IAM potentially helpful regarding your use case as well:

share|improve this answer

With duo_unix, you can add two-factor authentication for any SSH login method, and with the Duo OpenVPN integration, you can add two-factor authentication to OpenVPN.

Disclaimer, I work for Duo.

share|improve this answer
Disclaimer, Duo == awesome hawt sauce. That's 1+ for you, Sir. – amateur barista Aug 7 '12 at 18:36

EC2 allows you to setup your machines with different SSH certificates that you can create, the easiest solution for you would be to just create one that requires a password.

Also be aware of the security limitations of EC2, the security is peripheral and you don't know which machines are doing what inside so place strict security to communicate between machines, some strong encryption VPN (OpenVPN or stunnel) is highly desired for this.

share|improve this answer
You can't force an ssh key to have a passphrase though. – Stewart Robinson Jan 17 '11 at 10:07
When you create the key you can make it so, EC2 web interface doesn't allow you to but you can do it from the command line – lynxman Jan 17 '11 at 10:09
Yes but an authenticated user can just go and create a key with an empty phrase and use that which doesn't really help me be "Bank" secure. – Stewart Robinson Feb 2 '11 at 14:26
So you're defeating your own question then :) – lynxman Feb 2 '11 at 14:34
1  
I don't think SSH is the ticket here. Unless you do SSH -> Radius for auth, and have 2 factor on the radius server... – samsmith Jan 18 '12 at 23:20

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.