Skip to content

Instantly share code, notes, and snippets.

@jlucaso1
Last active December 2, 2025 12:03
Show Gist options
  • Select an option

  • Save jlucaso1/139de3b6200f493bcf1c40086aa2fb55 to your computer and use it in GitHub Desktop.

Select an option

Save jlucaso1/139de3b6200f493bcf1c40086aa2fb55 to your computer and use it in GitHub Desktop.
Configure Oracle Cloud Machine
# change PasswordAuthentication to yes
sudo sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
sudo service sshd restart
# read from keyboard and store in a variable the username and password
read -p "Enter username: " username
read -p "Enter password: " password
# create a user with the username and password
sudo useradd -m -p $(openssl passwd -1 $password) $username
# add the user to the sudo group
sudo usermod -aG sudo $username
#create global git configuration
read -p "Enter git email: " email
read -p "Enter git name: " name
git config --global user.name $name
git config --global user.email $email
#update and upgrade
sudo apt-get update -y && sudo apt-get upgrade -y
#install last version of node js
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs chromium-browser
#install yarn
sudo npm install -g yarn
read -p "Do you want to install docker? (y/n): " docker
if [ $docker = "y" ]; then
sudo apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-compose
#finish if
# put the user in the docker group
sudo usermod -aG docker $username
fi
# login as the user
sudo su $username
# configure git to store credentials in the user's home directory
git config --global credential.helper store
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment