ssh-keygen -b 2048 -f < key> .pem -m PEM -t rsa
Change Permission of SSH Key File
Connecting to Cloud With SSH
ssh -i ./cloud-key -o PubKeyAcceptedAlgorithms=+ssh-rsa username@hostname
If server does not allow ssh-rsa, add -o PubKeyAcceptedAlgorithms=+ssh-rsa
ssh -i ./cloud-key -o PubKeyAcceptedAlgorithms=+ssh-rsa username@hostname
Change Linux User Password
Upload file to Remote Server
scp -i < ssh-key> < file-to-upload> < username> @< host> :< path>
tar --use-compress-program=lz4 -cf < file-name> .tar.lz4 < folder-name> /
Decompress folder with LZ4
tar --use-compress-program=lz4 -xf < file-name> .tar.lz4
gcloud auth revoke < ACCOUNT>
gcloud config get project
gcloud config set project < PROJECT_ID>
gcloud compute instances list
gcloud compute ssh < NAME> @< INSTANCE_NAME> --zone=< ZONE>
Disconnect SSH connection
Add SSH login credential to $HOME/.ssh/config
gcloud compute config-ssh
gcloud compute instances start < INSTANCE_NAME>
gcloud compute instances stop < INSTANCE_NAME>
gcloud compute instances reset < INSTANCE_NAME>
Upload file from EC2 to S3
aws s3 cp < file> s3://< bucket> /< folder> /< file>
Download file from S3 to EC2
aws s3 cp s3://< bucket> /< folder> /< file> .