This sheet goes along with this SSH YouTube tutorial
$ ssh [email protected]
$ mkdir test
$ cd test
$ touch hello.txt
$ sudo apt-get install apache2
$ ssh-keygen
> cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys
$ touch test.txt
$ scp ~/test.txt [email protected]:~
Create account->create droplet
$ ssh-keygen -t rsa
Add Key When Creating Droplet
$ ssh root@doserver
$ ssh-add ~/.ssh/id_rsa_do
(or whatever name you used)
$ ssh root@doserver
$ sudo apt update
$ sudo apt upgrade
$ adduser brad
$ id brad
$ usermod -aG sudo brad
$ id brad
> ssh brad@doserver
$ ssh root@doserver
$ cd /home/brad
$ mkdir .ssh
$ cd .ssh
$ touch authorized_keys
> sudo nano authorized_keys
(paste in the id_rsa_do.pub key, exit and log in as brad)
$ sudo nano /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
$ sudo systemctl reload sshd
$ sudo chown -R brad:brad /home/brad
$ chmod 700 /home/brad/.ssh
$ sudo apt install apache2 -y
$ ssh-keygen -t rsa
(id_rsa_github or whatever you want)
$ ssh-add /home/brad/.ssh/id_rsa_github
```$ eval `ssh-agent -s````
$ git clone [email protected]:bradtraversy/react_otka_auth.git
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ npm install
$ npm start
$ npm run build
$ sudo mv -v /home/brad/react_otka_auth/build/* /var/www/html
Very useful tutorial I say. I must say something and that's in order to access a self hosted server that doesn't have an easy web access like DigitalOcean has you have to become creative and find different means to copy and paste your public key to the server you're trying to access via SSH. One of the means, probably craziest and best at the same time in case of desktop server would be use of pastebin service with time-limited access. Our server runs desktop version of Ubuntu MATE, running as virtual machine under ProxMox on a physical machine, basically self hosted server. Console is simply just remote monitor and there is no shared clipboard feature so the only way I can copy paste between local machine and guest system on a remote server is using something like pastebin.