Skip to content

Instantly share code, notes, and snippets.

@matijagrcic
Created June 3, 2022 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matijagrcic/c3fad9213b2d5904a139504460279b7d to your computer and use it in GitHub Desktop.
Save matijagrcic/c3fad9213b2d5904a139504460279b7d to your computer and use it in GitHub Desktop.

Change permission (chmod 400 myKey.pem) of pem key on Windows

$keyName = "SomeKeyName.pem"

icacls.exe $keyName /reset

icacls.exe $keyName /grant:r "$($env:username):(r)"

icacls.exe $keyName /inheritance:r

Get identifier for nvme disks which are show in the AWS Console

#ssh into ec2 instance
sudo apt-get install yum
sudo apt-get install nvme-cli
sudo nvme list

Copy ssh keys to attached instance

sudo mkdir /mnt/tempvol
sudo mount /dev/nvme0n1p1 /mnt/tempvol
cp /home/bitnami/.ssh/authorized_keys /mnt/tempvol/home/bitnami/.ssh/authorized_keys

Increase disk size when modifying volume

df -h 
sudo growpart /dev/xvda1 1
sudo resize2fs /dev/xvda1
df -h 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment