Thursday, April 27, 2017

New Ubuntu EC2 Instance things to remember

if you want to attach an existing EBS volume to the instance, make sure it's in the same Availability Zone (like "us-east-1c")

To SSH at all:
download that private key that they make you create as part of the setup consolessh -i (thatkey.pem) -l ubuntu
(there's one user created at the start, called ubuntu)sudo adduser dantassesudo vim /etc/group # and add dantasse to sudo groupsudo vim /etc/ssh/sshd_config # and set PasswordAuthentication to yessudo /etc/init.d/ssh reload
Now you should be able to SSH.

Attach the EBS volume on the AWS console. For example, attach it as /dev/sdf. Because it's Ubuntu, it will be attached as /dev/xvdf instead. (because reasons :P) You have to mount it still, though. Say you want to mount it at /data:sudo mkdir /datasudo mount /dev/xvdf /data