Initial setup of my headless Ubuntu VPS as a webserver with Nginx
Windows Applications
I’m locally using a Windows machine. After trying various programs, here are the ones I’ve ended up using:
MobaXterm
SSH Client (terminal access)
WinSCP
SCP Client (file transfer)
Sublime
code editor
Chrome
browser - when in developer mode (F12), you can right-click on the refresh button to hard-reload the page or clear the cache & reload
Helpful for connecting with SSH
Setting %Home% on Windows
In Windows (unlike in Linux), the HOME environment variable isn't set by default. Some programs that run in the command line / originally came from Linux expect HOME to exist - I set it to my user's home directory. This issue first came up when I was using ssh to connect to the server, as it expected my private key to be found at %HOME%/.ssh/id_rsa
Updating the known_hosts File
If you come across the “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!” error when trying to ssh into the server, you need to update the known_hosts file (%HOME%/.ssh/known_hosts) on your local machine:
-
$ ssh-keygen -R [remote host]
Removes all keys associated with the remote server from the known_hosts file
-
$ ssh-keyscan -t rsa [remote host] >> ~/.ssh/known_hosts
Fetches the keys of type rsa from the server and write them to known_hosts
Tutorials that I followed