How to Configure SSH Authentication With No Password on VirtualBox VM

These are instructions for if you have multiple keys in your ~/.ssh folder. It also assumes you already have port forwarding for SSH already setup on your VM (you can already ssh in with a password). On host machine: ssh-keygen -t rsa -C "user@localhost" You will see this: Enter file in which to save the key (/Users/darryl/.ssh/id_rsa): If ~/.ssh/id_rsa does not already exist you can press enter, if it does exist enter a different file path (ex. [Read More]
Notes 

How to Disable Password for sudo Command

Edit visudo file:

sudo visudo

To run the poweroff command as the user username add the following line:

username ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown
Notes 

Install new version of Python and virtualenv using that version on Ubuntu

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.9
sudo apt install python3.9-dev
sudo apt install python3.9-distutils
sudo apt install python3.9-venv

From directory in which we want to install virtual env:

python3.9 -m venv env
Notes 

Install psycopg2 package in python

sudo apt update
sudo apt install python3.9-dev
sudo apt install libpq-dev
sudo apt install build-essential
pip install psycopg2
Notes 

Fix git loose object corrupt

To fix the following error: fatal: loose object cbcaa4621da26a9ca57e97d797c6df867c824173 (stored in .git/objects/cb/caa4621da26a9ca57e97d797c6df867c824173) is corrupt

rm -fr .git
git init
git remote add origin [repo-url]
git fetch
git reset --mixed origin/master
git branch --set-upstream-to=origin/master master

Example repo-url: https://[user]@bitbucket.org/[user]/[repo].git

Notes