How can I tell the ec2 instance to switch to a non-root user via this runner?
See original GitHub issueAll examples I have seen use a docker image, which has a user
parameter.
But I’m not using docker. How do I then tell the action-runner to run as non-root (ubuntu
in this case)
I tried many different ways, but no matter what I do the current user remains root
- name: Who Am I?
run: |
sudo su - ubuntu
whoami
- name: Who Am I?
run: |
sudo -u ubuntu bash
whoami
- name: Who Am I?
shell: bash -l {0}
run: |
su - ubuntu
whoami
I can’t find anything on the EC2 side that will let me change the default user. When I connect via ssh it gives the root@ip
address.
I have everything already installed/configured under ubuntu
.
If this is not the right place to ask if you know where I can find this info please let me know as I have spent many hours searching and can’t find any information.
Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Run the CodeDeploy agent with a non-root profile
Test the setup by verifying that the CodeDeploy agent is installed and running with the correct user on your Amazon EC2 instance.
Read more >The Kubernetes executor for GitLab Runner
Read more about resources check during prepare step. ... This example creates a user and group called nonroot and sets the image to...
Read more >Cloud Agent for Linux Installation Guide
Log into the Qualys Cloud Platform and go to Help >. About to see the URL your hosts need to access. - To...
Read more >How to setup Remote Execution using non-root user on ...
Check if rexuser can run the sudo commands without password. ... Note: When running Ansible roles on a client using non root user...
Read more >aws_instance | Resources | hashicorp/aws
user_data - (Optional) User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see user_data_base64 instead.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While EC2 user data script is run as
root
, it is possible to use a non-root user if actions-runner is installed as a service (using thesvc.sh
script). See e.g. https://github.com/philips-labs/terraform-aws-github-runner/blob/develop/modules/runners/templates/install-config-runner.sh#L33I think it could, especially now with the newly-added
runner-home-dir
option (said pre-baked directory could be owned by that non-root user, so file permissions probably would not cause issues).@machulav what do you think?