Raja CSP Raman

Credits: treewebdesign.weebly

Requirement story:
Assume your colleague doesn’t have the same SSH key which is used to connect the AWS EC2 machine. However, she has her own SSH key in her machine.

She is asking you to help in her situation.

Solution:

Get into EC2 by simple ssh

ssh -i "/path/to/sshkey.pem" ubuntu@ec2-1-1-1-1.us-east-2.compute.amazonaws.com

Once you are in, just check whether key available in the machine:

cat ~/.ssh/authorized_keys

You might see some keys are available in the authorized keys like below:

ssh-rsa ...Iv abc

Regardless the previous key available or not, you just add your colleague’s SSH key in the authorized_keys

Done!

Ask your friend to verify from her machine to AWS EC2 by using her existing SSH key.

--

--

s3 bucket —AWS

You might have got an error like below when you deal with s3 commands in terminal:

SyntaxError: invalid syntax

I will share my scenario and talk about the solution in this article.

In terminal, when I typed

aws s3

it threw error as below:

aws s3
Traceback (most recent call last):
File "/opt/anaconda3/envs/py38/bin/aws", line 5, in <module>
from aws.main import main
File "/opt/anaconda3/envs/py38/lib/python3.8/site-packages/aws/main.py", line 23
print '%(name)s: %(endpoint)s' % {
^
SyntaxError: invalid syntax

At first I didn’t have a clue about this error. Later, I figured out that aws library in my custom environment throwing error.

So, I had to get out of my custom environment by using

conda deactivate

then gave it a try

aws s3

Now, it didn’t throw invalid syntax error.

Happy S3ing!!

--

--