Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm able to run a user-data script successfully, but it runs as root. I start up a few long running processes with this script, and would like them to be non-privileged processes. Is there some way to accomplish this, either with user-data scripts or some other method? I'm running an AMI based on Amazon Linux 2012.03.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Amazon Linux uses cloud-init to implement the ability to run scripts from user-data, a tool invented by alestic.com, and expanded by Ubuntu. It is currently supported by the Ubuntu distro (via the cloud-init package), and by the Amazon Linux distro.

I'm not aware of a built-in way to run as a different user, but since cloud-init supports shell-scripts you could just run a script that starts a process as another user. The standard unix tools are available for this, such as sudo or su.

share|improve this answer
    
Thanks, I probably should have thought of that :) –  Ryan May 19 '12 at 21:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.