Skip to content

Latest commit

 

History

History
203 lines (155 loc) · 4.44 KB

ubuntu.md

File metadata and controls

203 lines (155 loc) · 4.44 KB

Installing Ubuntu Server Operating System

1) Assigning a fixed IP-Address

sudo cd /etc/netplan
sudo nano  01-network-manager-all.yaml

Type the following in the file

# Let NetworkManager manage all devices on this system. 
#Use Tab Space to maintain parent and child.

network:
    version: 2
    renderer: NetworkManager
    ethernets:
        eno1:
            dhcp4: false
            addresses:
                - 163.143.87.200/24
            routes:
                - to: default
                via: 163.143.87.1
            nameservers:
                addresses: [163.143.1.100]

Save the file and exit (press Control + X, and Y).

Control + D

Next, type the following command on the terminal:

sudo netplan apply

2) Setting up SSH so that we can do configurations easily

sudo apt install -y openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh
sudo systemctl status ssh
sudo ufw enable
sudo ufw allow ssh    
sudo ufw reload

Now, login remotely into the server using ssh, and perform any of the below steps.

3) Installation of Remote Desktop

Click here for the detailed instructions

sudo apt install vim xrdp -y
sudo systemctl status xrdp
sudo usermod -a -G ssl-cert xrdp
sudo vi /etc/xrdp/startwm.sh
# Add below statements above the line test -x (line 32 around)    
Unset DBUS_SESSION_ADDRESS
Unset XDG_RUNTIME_DIR
# Save the file and exit by pressing `ESC` + `:` + `wq` + ENTER
sudo systemctl restart xrdp 
sudo systemctl status xrdp
sudo ufw status
sudo ufw default allow outgoing
sudo ufw default deny incoming 
sudo systemctl status ufw.service
sudo ufw allow 3389/tcp
sudo ufw reload

4) Prevent Network Idle Sleep

Click here for the detailed instructions

 sudo vi /etc/avahi/avahi-daemon.conf
# Update  domain-name=local  to domain-name=.alocal
 
#Save the file and exit
sudo vi /etc/default/avahi-daemon
# Update AVAHI_DAEMON_DETECT_LOCAL=1 to AVAHI_DAEMON_DETECT_LOCAL=0
# Save the file and exit
sudo systemctl disable systemd-networkd-wait-online.service
sudo systemctl mask systemd-networkd-wait-online.service

5) Prevent remote network disconnection during idle

sudo apt install wget openssh-server -y 

sudo vi /etc/ssh/sshd_config
#Write the following text at the end of the file
ClientAliveInterval 600
TCPKeepAlive yes
ClientAliveCountMax 10
#Save the file and exit
sudo /etc/init.d/ssh restart

6) Installation of GUI, Anti-virus, OpenSSH, Tex, CURL and Other Python Libraries

sudo  apt-get  update && sudo  apt-get  upgrade -y
sudo  apt-get  install -y  texlive-xetex texlive-full texstudio texmaker texlive-latex-extra pandoc curl  libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev python3-pip openssl libssl-dev build-essential libcurl4-gnutls-dev libxml2-dev tasksel lightdm clamav clamav-daemon mailutils gnupg2  vim bash-completion

Choose lightdm option and No configuration when asked. May take 1 hour to install of the above packages.

Once you see this text Pregenerating ConTeXt MarkIV format. This may take some time... Keep pressing Enter button until you see new lines on the screen.

Next, once you see this text Building format(s) --all. This may take some time... wait for sometime and see whether it is ending or not. If you feel screen got hanged, keep on pressing Enter button.

pip install click mitmproxy

Setting up the antivirus

 sudo systemctl stop clamav-freshclam

Note: Choose 'No Configuration' option. Press any key to continue...

sudo freshclam -d -c 2
sudo systemctl start clamav-freshclam
sudo systemctl enable clamav-freshclam
sudo systemctl status clamav-freshclam

Press Q button.

Setting up the tasksel GUI. Choose 'Ubuntu/Debian Desktop'. Press any key to continue...

sudo  tasksel

7) Allowing a program to utilize more memory

echo 1 | sudo tee /proc/sys/vm/overcommit_memory

8) Recording the history of each user's commands with a timestamp

sudo vi /etc/profile
export HISTTIMEFORMAT="%F %T " 

Save the file and exit.

sudo reboot