Bastillion for EC2 is a powerful web-based SSH console designed to facilitate the management of multiple EC2 instances on Amazon Web Services (AWS). It allows users to execute commands, share terminal commands, and upload files across different instances simultaneously. This blog post will guide you through various aspects of using Bastillion for EC2, from installation to management, while troubleshooting common issues.
Understanding the Basics of Bastillion for EC2
Imagine you are a conductor of an orchestra, and each musician (your EC2 instances) can play their notes (commands) simultaneously or selectively. Bastillion acts as the baton that allows you to direct your musicians efficiently toward a harmonious performance (effective server management). Just as a conductor can choose which instruments to highlight, you can select specific instances to run commands or scripts. This powerful functionality allows you to manage a symphony of servers effortlessly.
Prerequisites
- Open-JDK or Oracle JDK 1.9 or greater
- Install Authy or Google Authenticator for two-factor authentication
How to Run Bastillion-EC2 Bundled with Jetty
- Download the Bastillion-EC2 package from GitHub Releases.
- Set the necessary environment variables for your operating system.
For Linux/Unix/OSX:
export JAVA_HOME=path-to-jdk export PATH=$JAVA_HOME/bin:$PATH
For Windows:
set JAVA_HOME=C:\path-to-jdk set PATH=%JAVA_HOME%\bin;%PATH%
- Start Bastillion:
- For Linux/Unix/OSX:
. startBastillion-EC2.sh
- For Windows:
startBastillion-EC2.bat
- For Linux/Unix/OSX:
Using Bastillion-EC2
- Open your browser and navigate to
https://
.:8443 - Login with:
- Username: admin
- Password: changeme (For AMI instances, default is the Instance ID)
- Configure an IAM Role with your Account ID and set the ARN in Bastillion-EC2.
- Import the Bastillion-EC2 public SSH key in the EC2 AWS console.
- Create EC2 instances using the imported key.
- Start composite-SSH sessions or create scripts for multiple sessions.
- Add instance administrators and monitor their sessions.
Managing User Access and SSH Key Pairs
User access can be restricted via tags in a user’s profile, ensuring that only authorized users can manage specific instances. You can also supply a custom SSH key pair by editing the Bastillion-EC2 Config.properties
file.
Example Configuration for Custom SSH Key
# regenerate SSH keys
resetApplicationSSHKey=true
sshKeyType=rsa
privateKey=/Users/kavanagh/.ssh/id_rsa
publicKey=/Users/kavanagh/.ssh/id_rsa.pub
defaultSSHPassphrase=myPa$$w0rd
Troubleshooting Common Issues
- If you encounter issues logging in, make sure your firewall settings allow traffic on port 8443 or 443.
- If the application doesn’t start, ensure you have the correct Java version and environment variables set.
- For issues with SSH keys, double-check your key file paths in the Bastillion-EC2
Config.properties
. - If terminal sessions are slow, verify your network connection and instance performance.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
With Bastillion for EC2, managing multiple AWS instances has never been easier, allowing users to execute commands, upload files, and control access seamlessly. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.