Posts

Showing posts with the label aws

Cannot change file permission after chmod 400

try sudo chmod 400 file name or change file location to different place

rsync to aws instance

Pull rsync -avhe   'ssh -i taclogisticsnewcom.pem'  centos@13.126.252.11:/home/tacportal/web/portal.taclogistics.net/public_html/application/config/tacportal_db.sql . push rsync -avhe   'ssh -i taclogisticsnewcom.pem' tacportal_db.sql  centos@13.126.16.79:/home/centos/ ssh -i /users/solzy/desktop/ssh_key.txt ubuntu@51.89.153.135 -p 5965

rsync - mkstemp failed: Permission denied (13)

Error:   rsync - mkstemp failed: Permission denied (13) cause: wrong permission where you want to upload file solution: make sure you have the right permission for the user with which you are uploading the file to the instance rsync -avhe   'ssh -i taclogisticsnewcom.pem'  rsync -avhe   'ssh -i taclogisticsnewcom.pem' tacportal_db.sql  centos@13.126.16.79:/home/centos/ here the user is centos and check the permision of /home/centos folder by ll

Get the fingerprint of an existing SSH public key

How to get: SHA256 hash of an existing key ? Something like this:  SHA256:3VvabBNtRF0XEpYRFnIrhHX6tKZq/vzU+heb3dCYp+0 blah@blah.com MD5 (is it MD5?) of an existing key ? Something like this:  b6:bf:18:b8:72:83:b7:fb:7d:08:98:72:1f:9f:05:27 Randomart for an existing key ? Something like this: Install  openssh  and  openssl  packages which contain the commands. # get the SHA256 and ascii art ssh-keygen -l -v -f /path/to/publickey # get the MD5 for private key openssl pkey -in /path/to/privatekey -pubout -outform DER | openssl md5 -c # get the MD5 for public key openssl pkey -in /path/to/publickey -pubin -pubout -outform DER | openssl md5 -c

Match AWS PEM file fingerprint whether it is for an instance or not

login to aws portal and then go to key pairs and then select the key to view the fingerprint of the key now to match with the key that you have on the system just do execute this command in the terminal where you have stored the key openssl pkcs8 -in path_to_private_key -inform PEM -outform DER -topk8 -nocrypt | openssl sha1 -c (stdin)= d4:bf:dd:f3:89:36:79:1a:32:f9:5e:d6:11:85:0c:9c:6f:6e:f1:af you can see the fingerprint just match with the key you have.

PEM key lost AWS

https://aws.amazon.com/premiumsupport/knowledge-center/recover-access-lost-key-pair/ https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html#replacing-lost-key-pair 1. write down the instance ID, AMI ID, & Availability zone of the original instance In the root device field, take note of the device name for the root volume(for example /dev/sda1 or /dev/xvda). choose the link & write down the volume ID in the EBS ID field(vol -XXXXXXXXX) Note: Availability zone Instance ID elastic IP create an instance with same AMI 2.deattach the storage from original one and attached with new one