1
I don't even know if this is possible but I thought I'd ask anyays!
I'm wondering, is it possible to run a script immediately after a SSH login? My thought is to make a python script that executes immediately once a user logs in requiring user input (such as typing in a password). If validation fails then it quits the users session.
This would also be handy for logging connections (sending email alerts).
EC2 is fantastic but if someone gets a hold of my private key then can then access the servers. I know there is ways to prevent random access with strong security groups and port changing, but hey, a password trap on login can't hurt!
Anyone know if this might be possible?
You can configure sshd to require a password in addition to a public key (two factor authentication). It's best to ask this sort of question on ServerFault.com or SuperUser.com. – dave4420 – 2013-03-24T22:22:35.197
2Does this actually have anything to do with EC2? – phs – 2013-03-24T22:24:06.160
I would suggest a different title, like secure agent ssh login or something similar. – DigitalRoss – 2013-03-24T22:45:26.263