Understanding ssh Agent Forwarding

SSH login works.

git pull doesn’t.


You connect to a server:

ssh root@server

No password. All good.

Then:

git pull origin main

Boom:

Permission denied (publickey)

You check:

ssh-add -L

And get:

Could not open a connection to your authentication agent.

At this point, it feels wrong.

“I logged in using SSH keys… why is Git failing?”


The trap

Logging in via SSH does not mean the server has your keys.

Continue Reading »

Install LetsEncrypt certificate

Today I installed LetsEncrypt certificate on one of the production server.

I can not believe it is so simple to secure a website running on an Ubuntu server

sudo apt-get install certbot python-certbot-nginx
sudo certbot --nginx -d mydomain.com -d www.mydomain.com

It even configures nginx (or apache) server for you.

To manually renew run the following:

certbot renew --quiet

But you don’t have to, cause certbot is so awesome that it automatically adds an entry into crontab so that certbot runs twice daily. There is an entry under /etc/cron.d/certbot

Continue Reading »