This is an old revision of the document!


Setup

Server Setup

  • Login to the server via SSH as root
  • Install sudo, create the main user, and add him to the sudoers group
    # apt install sudo
    # adduser <user>
    # vi /etc/group (add <user> to line "sudo:x:27:<user>")
  • (VPS) change the machine name:
    sudo edit /etc/hostname
    sudo edit /etc/hosts
  • enable force_color_prompt=yes in file ~/.bashrc
  • copy /home/user/.bashrc to /root and modify PS1 prompt color (32m –> 31m)

Security

  • Configure SSH Access
  • Install UFW Firewall
  • Disable root login by changing file /etc/passwd from line 1 to line 2
    root:x:0:0:root:/root:/bin/bash
    root:x:0:0:root:/root:/sbin/nologin

Install and configure packages

  • Additional packages
    $ sudo apt update
    $ sudo apt install vim
    $ sudo apt install zip
    $ sudo apt install rename
    $ sudo apt install rsync
  • Change visudo editor
    $ sudo update-alternatives --config editor