- Add user
adduser username- Make the user a
sudoer
usermod -aG sudo username- create
.sshdirectory
mkdir ~/.ssh- Create RSA keys and set a passphrase
ssh-keygen -t rsa -b 4096 -C "[email protected]"- Adding your SSH key to the ssh-agent
eval "$(ssh-agent -s)"- Set the Identity file in the
.ssh/config
nano ~/.ssh/configHost *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa-
Go ahead and add the SSH public key to GITHUB 👍
-
Copy the ssh keys to the working machines and gain access to the server
- Edit
.bashrcfile
nano ~/.bashrc- Add the following content
SSH_ENV=$HOME/.ssh/environment
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > ${SSH_ENV}
echo succeeded
chmod 600 ${SSH_ENV}
. ${SSH_ENV} > /dev/null
/usr/bin/ssh-add
}
if [ -f "${SSH_ENV}" ]; then
. ${SSH_ENV} > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi- Save the file and re-open the terminal, you might need to enter the passphrase once but then it shouldn't be prompted again
-
Copy over the keys to the local machine
-
Use
ssh-copy-idto enable ssh access
ssh-copy-id -i <key-path> <username>@<server>- Update registry
sudo apt-get update- Uninstall any old versions of docker
sudo apt-get remove docker docker-engine docker.io- Install Docker
sudo apt install docker.io- Start and Automate Docker
sudo systemctl start dockersudo systemctl enable docker- Add a group if does not already exist
sudo groupadd docker- Add the connected user "$USER" to the docker group. Change the user name to match your preferred user if you do not want to use your current user
sudo gpasswd -a $USER docker sudo usermod -aG docker $USER-
Either do a newgrp docker or log out/in to activate the changes to groups.
-
Install
docker-compose
sudo apt install docker-compose- Update registry
sudo apt-get update- Install NodeJS and NPM
sudo apt-get install nodejssudo apt-get install npm- Install NVM for better NodeJS version management
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash- Install LTS version of NodeJS
nvm install --lts- Set it as the default for the system
nvm alias default <version number>
git clone ssh://[email protected]/razrlab/titan-base.git && \
git clone ssh://[email protected]/razrlab/titan-com.git && \
git clone ssh://[email protected]/razrlab/titan-web.git && \
git clone ssh://[email protected]/razrlab/titan-queue.git && \
git clone ssh://[email protected]/razrlab/titan-public-react.git && \
git clone ssh://[email protected]/razrlab/titan-scripts.git && \
git clone ssh://[email protected]/razrlab/titan-extras.git && \
git clone ssh://[email protected]/razrlab/docker-redis.gitnpm i -g pm2 prettier eslint yarncd ~/titan-base && sh ./devinstall.shcd ~/titan-queue && docker-compose up -dcd ~/titan-base && docker-compose up -dsudo apt-get install -y build-essential libpng-dev