Category Archives: Amazon Web Services (AWS)

Locked out on EC2 Ubuntu because of chmod?

Locked out on EC2 Ubuntu because of chmod? See this video and use the script below. Content-Type: multipart/mixed; boundary=”//” MIME-Version: 1.0 –// Content-Type: text/cloud-config; charset=”us-ascii” MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=”cloud-config.txt” #cloud-config cloud_final_modules: – [scripts-user, always] –// Content-Type: text/x-shellscript; charset=”us-ascii” MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=”userdata.txt” #!/bin/bash chown root:root /home chmod 755 /home chown ubuntu:ubuntu /home/ubuntu -R chmod 700 /home/ubuntu chmod 700 /home/ubuntu/.ssh chmod 600 /home/ubuntu/.ssh/authorized_keys –//

Read More »

Mounting EBS volume in EC2

Refer http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html for detailed instructions. Create a volume in EBS screen Attach it to your desired EC2 instance From the command line issue the following commands lsblk – to know the device name sudo file -s /dev/xvdf  (if it says “data” thats good to go) sudo mkfs -t ext4 /dev/xvdf (format the new volume) sudo mkdir /my_data (new folder to mount into) sudo mount /dev/xvdf /my_data In case you have expanded the volume size to a bigger value, give the commands below (Refer http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html?icmpid=docs_ec2_console) Note: After modifying…

Read More »

Setup codecommit on Windows

For detailed instructions see – http://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-ssh-windows.html These are the main commands to give in Git console or Terminal. cd ~ ssh-keygen cd .ssh notepad codecommit_rsa.pub Copy the key and upload it to AWS IAM. Copy the SSH Key ID generated created and paste it in ~/.ssh/config file. The file content will be Host git-codecommit.*.amazonaws.com     User APKAXXXXXX     IdentityFile ~/.ssh/id_rsa Go back to terminal and give following commands ssh git-codecommit.us-east-2.amazonaws.com If you see a success message, you can continue with cloning repository. git clone…

Read More »

error: Uh oh ...