Open main menu

CDOT Wiki β

Changes

OPS345 Lab 1

662 bytes added, 02:52, 11 December 2021
Change the default username
== Change the default username ==
For security purposes we're going to remove the default ec2-user. That would be simple if you were sitting in front of the machine, but since you can only connect to it via SSH and the only user you can SSH as is ec2-user: it takes some extra work. You're going to do this for every machine you create in OPS345, so get used to the steps. It's good practice:
* Create yoursenecaid Use the useradd command to create a new user. To make your life easier: set the username to be the same as your myseneca username, no with the same capitalization.You do not need to set a password for this user. Passwords can be guessed using a brute-force attack. SSH keys are practically immune to such attacks.* Make sure your new user can run sudo without a password, create same as ec2-user. Create '''/etc/sudoers.d/10-ops345-users ''' with these contents:
<source>yoursenecaid ALL=(ALL) NOPASSWD:ALL</source>
* Allow yourself your new user to log in using your the SSH key:you already have. You could create a new key pair instead, but you don't have to
<source>
# cd /home/ec2-user/