Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
linenumberstrue
su example_user
cd ~
mkdir -p ~/.ssh && sudo chmod -R 700 ~/.ssh/
 && cd .ssh/ && vim authorized_keys

Make the root account not accessible for direct login and make the server accessible only through ssh key

Code Block
languagebash
linenumberstrue
sudo vim /etc/ssh/sshd_config
 
PermitRootLogin no
PasswordAuthentication no

Remove Password as a requirement to run sudo commands

Code Block
languagebash
linenumberstrue
sudo visudo
%sudo	ALL=(ALL) NOPASSWD:ALL
or 
example_user    ALL=NOPASSWD: ALL

Restart the ssh service for the changes to take affect

Code Block
languagebash
linenumberstrue
sudo service ssh restart

Checking Config errors in Nginx

 

Code Block
languagebash
linenumberstrue
nginx -t -c /etc/nginx/nginx.conf