how frequently does the letter "e" appear in:
q: aws - is it safe to remove ec2-user? i'm using amazon linux ami.
when you create ec2 instance, by default the username is ec2-user.
i want to create another user (lets say user1) with the same privileges as ec2-user, and i want to delete ec2-user. is it safe to delete the ec2-user?
can you provide me linux commands how to do this please?
sorry i'm noob when it comes to linux commands.

a: the steps to create a user with the same rights as ec2-user are:


*

*create the account


*

*useradd newaccount


*set a password for the account


*

*passwd newaccount


*add the account to the sudo group


*

*usermod -ag sudo newaccount


*log in with the account


*

*su - newaccout


*create a .ssh directory


*

*mkdir .ssh


*log out of newaccount


*

*exit


*now you are back in root, copy the authorized_keys file, and set security on .ssh


*

*cp /home/ec2-user/.ssh/authorized_keys /home/newaccount/.ssh/authorized_keys

*chmod 700 /home/newaccount/.ssh 



log all the way out of the system, and try and log in with the newaccount. 
once logged in invoke sudo su to ensure it has the correct rights. you should get an error message.
the last step is to replace ec2-user with newaccount in the file:


*

*/etc/sudoers.d/cloud-init


the easiest way is with the nano editor, but there are many other editors in linux. 
if this works, then you have a new account with the same priviledges as the ec2-user (and you have also removed ec2-user from the ability to become root) and can safely delete (or ignore) that account.

a: on aws, instances are configured at launch using cloudinit. for amazon linux ami, this is information is stored under /etc/cloud/cloud.cfg.d/00_defaults.cfg section system_info.
so, imho, the easiest solution to achieve what you want is to give the following user data when launching your instance:
#cloud-config
system_info:
  default_user:
    name: user1

nb. this might not work exactly the same on different distributions where cloudinit's version differs.
useful links:


*

*https://docs.aws.amazon.com/awsec2/latest/userguide/user-data.html

*https://aws.amazon.com/premiumsupport/knowledge-center/ec2-user-account-cloud-init-user-data/

a: yes you can delete the default aws ec-user. you can add a new user and access the ec2 instance. but when you initially create an instance at same time an ssh pub/pri key pair is also generated corresponding to ec2-user. so   you have to first generate a new key pair in order to access ec-2 instance with new user.

a:   ****user add -----> useradd username**
  **user delete --> userdel username**** 

  but defaults user no need to delete , u can just change password 
  **password change - passwd username** 

far ubuntu 
   ****user add -----> useradd -m username**
   **user delete --> userdel username**** 


a: totally wrong and misguiding concept of deleting ec2-user whole aws cloud features monitoring and other event based things become corrupted and of no use? did you know about this consiquences or you need to do research on this still?

user
In that passage, there are 296 occurrences of the letter "e."
assistant