Initial setup of a Debian AMI instance
Jump to navigation
Jump to search
Initial connection must be as user "admin"
# ssh -l admin -A <IP address>
. This step will [usually] require the SSH user has access to the AWS-known SSH keys (*.pem
) allocated to the VM when it was created. E.g.,Amazon-CSE-key.pem
(Sydney) orAmazon-CSE-SNG-key.pem
(Singapore). These keys are instantiated in the VM'sauthorized_keys
file when it is created but may be overwritten with CSE's own keys during configuration (by cfengine).# sudo -s
Disable syntax highlighting in vi
(personal preference)
# echo "syntax off" > /root/.vimrc
Enable direct root login
Standard is that administrators have to log in as “admin” via SSH first and then use sudo
to get root privileges. However, when/if we configure the automounter for /home
this breaks the “admin” account which has its home there.
Solution? Enable direct root login and remove the “admin” account:
- Edit
/root/.ssh/authorized_keys
and remove everything before “ssh-rsa” on the first/only line - Logout and log back in as “root” to test
- Use
userdel -r admin
to get rid of the “admin” account(You can ignore the warning:
userdel: admin mail spool (/var/mail/admin) not found
)
Boot configuration
- As root:
- Append
- “consoleblank=0 ipv6.disable=1 audit=0 selinux=0 net.ifnames=0 biosdevname=0” (Buster)
- “ipv6.disable=1 audit=0 selinux=0 net.ifnames=0 biosdevname=0” (Bullseye)
to
GRUB_CMDLINE_LINUX
in/etc/default/grub
- Run
grub-mkconfig -o /boot/grub/grub.cfg
Timezone configuration (example)
As root:
- Run
ln -sf /usr/share/zoneinfo/Australia/Sydney /etc/localtime
- Check time synchronisation and zone with:
timedatectl
For hosts on a site host subnetwork (yours probably is!)
- Run
touch /etc/cloud/cloud-init.disabled
to prevent cloud initialisation running and, particularly, interfere with the start ofsshd
- Add
supersede routers +0.0.1.5;
to/etc/dhcp/dhclient.conf
after the main body (it will be 10.197.85.5 for Sydney and 10.197.89.5 for Singapore) - Reboot
Install updates and maybe reboot
apt-get update
apt-get upgrade
- Reboot, depending on updated packages