dimanche 27 septembre 2015

Override Default Username Using Instance User Data - CentOS 7 (x86_64) with Updates HVM

New to AWS and pretty new to Linux. I've successfully launched (and terminated) several CentOS 7 instances. Took a while to notice that the subject AMI uses a default user "centos" and does not allow login as "root" initially, which made for a number of SSH failed attempts. After installing nano, I was able to change the visudo file. However, many things still seem owned by root and inaccessible by centos (or the other user I created), making it difficult to get things done. I setup Apache, MySQL, and PHP and since www is owned by root, it has been difficult to get site content up. I've attempted to change ownership of directories that I need access to but having some trouble. My main questions are:

What does AWS guidance mean when they say users can "override this default username by using instance user data at time of instantiation?"

Specifically, I don't see a lot of guidance on the web about changing "user data". I'm assuming this means you can change the "specs" of the instance when it is launched.

Does anyone have an example of how to do this when setting up the instance? I would be particularly interested in knowing how to setup a user with root-like access. Alternatively, how to simply get rid of the "centos" user on this AMI and let initial login be from root. I think part of my problem is with unsuccessful editing of visudo, sshd_config, and authorized_keys.

I just want a CentOS 7 instance that has a user that is not restricted. This is mostly an independent study and will not be something other users will be given access to. Guidance on the web that I've seen so far is not exactly applicable to this specific AMI. I'm confident my ignorance is the greatest hurdle, but any pointers would be appreciated.




Aucun commentaire:

Enregistrer un commentaire