Skip to content

Commit 4d5d8a5

Browse files
committed
install SSM so you can log in to VM
1 parent 1cac75e commit 4d5d8a5

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

startup.sh

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
1-
#!/bin/sh
2-
# Use this to install software packages
3-
if VERB="$( which apt-get )" 2> /dev/null; then
4-
sudo apt-get update -y
5-
elif VERB="$( which yum )" 2> /dev/null; then
6-
sudo yum update -y
7-
else
8-
echo "WARNING: Could not update the system" >&2
9-
fi
1+
#!/bin/bash
102

11-
echo 'docker here ------------' > /tmp/output.txt
12-
which docker >> /tmp/output.txt
13-
echo 's3 buckets ------------' >> /tmp/output.txt
14-
aws s3 ls s3://tudelft-results-of-calculations >> /tmp/output.txt
15-
echo 'who am I ------------' >> /tmp/output.txt
16-
whoami >> /tmp/output.txt
17-
echo 'current dir ------------' >> /tmp/output.txt
18-
pwd >> /tmp/output.txt
19-
echo 'files in dir ------------' >> /tmp/output.txt
20-
ls -l >> /tmp/output.txt
3+
# Install SSM agent, so you can log in. This us the Ubuntu version
4+
# See https://repost.aws/knowledge-center/install-ssm-agent-ec2-linux#
5+
mkdir /tmp/ssm
6+
cd /tmp/ssm
7+
wget https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/debian_amd64/amazon-ssm-agent.deb
8+
sudo dpkg -i amazon-ssm-agent.deb
9+
sudo systemctl enable amazon-ssm-agent
2110

22-
aws s3 cp /tmp/output.txt s3://tudelft-results-of-calculations
2311
sudo shutdown -h now

0 commit comments

Comments
 (0)