xxxxxxxxxx
#To have access of your local machine to a server
#You need to do the following steps
#1: Create the key pair on your system by following command
eval $(ssh-agent -$)
ssh-keygen
it'll then ask you to enter the file name(required) and
enter phrase(optional), complete this process and you'll
have the key pair private and public file
#2: Take file.pub's key and put it in server's authorized_keys
(Authorized_keys file will be in your user's .ssh folder)
#3: On your local machine enter following again:
eval $(ssh-agent -$)
ssh-add /path/to/private-key-file
xxxxxxxxxx
> sudo apt-get install gnupg curl
// ------------------------------------
// ------------------------------------
> curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg \
--dearmor
// ------------------------------------
// ------------------------------------
// for Ubuntu 24.04 (Noble)
> echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
// ------------------------------------
// for Ubuntu 22.04 (Jammy)
> echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
// ------------------------------------
// for Ubuntu 20.04 (Focal)
> echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
// ------------------------------------
// ------------------------------------
> sudo apt-get update
// ------------------------------------
// ------------------------------------
// for installing the latest release of mongodb
> sudo apt-get install -y mongodb-org
// ------------------------------------
// for installing a specific version of mongodb
> sudo apt-get install -y mongodb-org=8.0.4 mongodb-org-database=8.0.4 mongodb-org-server=8.0.4 mongodb-mongosh mongodb-org-mongos=8.0.4 mongodb-org-tools=8.0.4