su - |
apt-get -y update apt-get -y upgrade apt-get -y install sudo vim unzip rsync sysstat cifs-utils nmap tcpdump tmux virt-what chrony smbclient ufw curl net-tools nload |
VIM detects the mouse, and copy pasting between two terminal windows is annoying because of this. Disable this as follows for root and jtel:
cat << EOFF >> ~/.vimrc set mouse-=a EOFF cp ~/.vimrc /home/jtel chown jtel:jtel /home/jtel/.vimrc |
The following command adds the jtel user to the sudo group:
adduser jtel sudo |
The following commands enable the firewall and allow ssh.
ufw --force reset ufw --force default deny incoming ufw --force default allow outgoing ufw allow ssh ufw --force enable |
The following commands install chrony and modify the basic chrony.conf file to remove usage of the default pool and any configured servers, and replace this with the 3 (very reliable) time servers from the German PTB.
# Replace all existing servers sed -i -e "s/^server /# server /" /etc/chrony/chrony.conf # Replace pool setting sed -i -e "s/^pool /# pool /" /etc/chrony/chrony.conf # Add PTB Servers cat << EOFF >> /etc/chrony/chrony.conf # Servers to use server ptbtime1.ptb.de iburst server ptbtime2.ptb.de iburst server ptbtime3.ptb.de iburst EOFF # Enable Chrony systemctl enable chrony # Stop (just in case it was started), then start and get status systemctl stop chrony systemctl start chrony |
systemctl status chrony chronyc sources |
The following script does the following:
# root user cat <<'EOFF' >> ~/.bashrc [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" aliasĀ git='printf "It looks like you are trying to run GIT as ROOT.\nFor jtel installations, GIT should always be run from the jtel user.\nIf you really want to run git as root, you will need to access it directly, using /usr/bin/git for example.\n"' EOFF sourceĀ ~/.bashrc # jtel user cat <<'EOFF' >> /home/jtel/.bashrc [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" EOFF |
virt-what |
The tools are installed as follows:
apt-get -y install open-vm-tools |
Hyper-V
The tools are installed as follows:
apt-get -y install hyperv-daemons |
KVM
The tools are installed as follows:
apt-get -y install qemu-guest-agent |
Other Hypervisors
Consult the manufacturer for further detals.
Reboot to load the new kernel if one was downloaded and make sure the guest tools are running OK.