Fix: Failed to install psycopg2 on Docker using Alpine Linux

I got this error when building my docker images using Linux alpine.

Command "python egg_info" failed with error code 1 in /tmp/pip-install-00rq050n/psycopg2/

And I fixed the issue by following this github issue

Register SSH Key To DigitalOcean

I just added new ssh key from my laptop into my digitalocean settings, to ensure next login in my laptop, I don’t need to type my password again and again. But after adding my ssh key and trying to login to my VPS, the ssh still asked me for a password.

Here is how I fix this following the documentation. I assuming that you guys know how to generate new ssh key. So below is next step after generating new ssh key.

$ cat ~/.ssh/ | ssh root@[] "cat >> ~/.ssh/authorized_keys"

After run single command above, I don’t need to type password once logging in to my VPS.



I just moved my project to another laptop including “.pem” file for remote ssh to AWS EC2.
Once I’m trying to login to remote ssh, accidentally the authentication prompted security warning like below.

The authenticity of host ' (' can't be established.
ECDSA key fingerprint is SHA256:*****************************.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '' (ECDSA) to the list of known hosts.
Permissions 0644 for '/Users/adiyatmubarak/.ssh/key.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/Users/adiyatmubarak/.ssh/key.pem": bad permissions

I guess because the file permission, and here is my current permission.

-rw-r--r--@  1 adiyatmubarak  staff  1675 Aug  5 13:19 key.pem

The problem solved after I only grant my user on my “.pem” file.

$ chmod 600 key.pem
$ ls -la
$ -rw-------@  1 adiyatmubarak  staff  1675 Aug  5 13:19 key.pem