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?