Open main menu

CDOT Wiki β

Changes

OPS345 Lab 1

774 bytes added, 22:48, 14 September 2021
First AWS VM
= First AWS VM =
* Deploy Create a new security group "ops345sg" with only the SSH port open. We'll look at security groups in more detail next week.* Instance == VM. AMI == VM disk image.* Use "Launch Instances" to deploy a pre-built Debian 10 VM "Amazon Linux 2 AMI (HVM), SSD Volume Type"Instance")VM. Not one of the other Amazon Linux AMIs.
** Instance type t2.micro - sort of kind of almost free
** Existing security Security group "defaultops345sg"
** Create a new RSA key pair named ops345-default-key, save it as ops345-default-key.pem on your workstation under a new directory ~/keys/ssh/
* Differences between Debian Amazon Linux and CentOS** /etc/yum.repos.d/amzn2-core.repo** Not linked to RedHat/IBM support cycles and policies.
* Explore the VM:
** connect with user ec2-user, ssh key
** no Many packages not installed by default in CentOS /are/ installed by default in Amazon Linux.** yum, use aptinstall telnet** no rpm, use dpkgsystemctl works the same way** systemctlNote iptables is not installed, we'll fix that in the next lab.
** passwd, shadow, group files
** netstat -atnup
** Create senecaid-admin yoursenecaid user, no password, add to wheel group, modify create /etc/sudoers.d/10-ops345-users with these contents:<source>yoursenecaid ALL=(ALL) NOPASSWD:ALL</source>*Allow yourself to log in using an SSH key:<source># cd /home/ec2-user/# cp -r .ssh/ ~andrew# chown -R andrew.users ~andrew/.ssh/</source>* Confirm can log ssh in as senecaid-user yoursenecaid and successfully sudo su-** Delete ec2-userincluding the home directory. Use the userdel command.