The below code snippet was used to add SSH users to RackSpace cloud CentOS Linux nodes being used as application servers and managed via RightScale. The SSH users were required during a testing phase so they could look through logs and make modifications to specific configuration files, etc. There are three things that have to happen to create the SSH user, allow them to login, and provide them the necessary rights on the server to accomplish their tasks which include adding the user, modifying the sshd config to allow password logins, and update the sudoers file to enable sudo access for wheel group users.
Recently I was working on a project that was using RightScale to manage RackSpace cloud nodes. One of the requirements of the project was to have application nodes scale automatically thus they were required to automatically install software, configure settings, and start services automatically on the RackSpace CentOS nodes being used. Most everything was fairly straight forward however some of the services we were using would not start properly and initially because of the lack of logging from the services we were unable to figure out what the problem was. Below I describe the problem in more detail along with the solution which involved updating a configuration file on the CentOS Linux servers and then restarting the services.
The other day I needed to create a RightScript shell script that would update a couple configuration files on a server that was being launched in the RackSpace Cloud via RightScale. I decided to use SED to find and replace content within the configuration files. The first pass at the script failed because what I thought were spaces ended up being tabs. Use the information below to represent a tab within a shell script when using sed.
I ran in to the weirdest error today. “sudo: unable to resolve host”. I got this error even running as root which was the really weird part. I was especially confused because I have been running Linux as my main OS for the better part of 10 years and have never run into this issue. Turns out the solution is very simple and almost elementary however I decided to make a quick post about it.
I was recently working on a Perl script that would SSH to another server and run a sudo command on the remote server that was failing. The error that was received is below.
Error: sudo: sorry, you must have a tty to run sudo
The reason for this is an update along the way with sudo locked it down further by adding the below line to /etc/sudoers configuration file.