Multiple SSH sessions on EC2 instances in a single place

Recently we changed the audit log format and the old schema became incompatible. The solution acceptable for us was to truncate existing log files instead of making an entire transition with an intermediary step, a cleanup step and so on.

Well, this approach seems to be a simple one, but the question is: how to truncate log files: one approach would have been to do that from our code. But that required a cleanup step that we wanted to avoid. Another one would have been to connect to EC2 and do that manually. But who wants to ssh on 27 hosts and truncate a file? Nobody.

Then we remembered that exists a very simple solution: a mechanism to handle multiple simultaneous SSH sessions on EC2 that also allow you to execute commands. It’s called Bastillion ( | github link: here). The entire setup takes less than 10 minutes and the only small issue for us was the fact it requires at least JDK 9 to run. Maybe without that, the whole install process would have been ready in 3 minutes. A big thumbs up for their documentation: short, but efficient and very well organized.

The nice things we found:

  • It comes as a web-based solution that can be installed on an EC2
  • You can create multiple users with different permissions (for more than 6 users you have to pay)
  • The admins can audit the commands executed by other users

As we said, we tested it with 27 sessions running in parallel and it ran almost instantly. Also, it could be a good solution to check live logs during operational events.

If you consider this post helpful, feel free to share it! We are happy to see our posts are spreaded in many places and the positive feedback is the fuel we need to continue writing!

Happy cloud computing!


One thought on “Multiple SSH sessions on EC2 instances in a single place

Comments are closed.