Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Running as non sudo user

Luca Carducci August 7, 2020

How can I run a command as "ubuntu" user in EC2?

I login with "ubuntu" but the script is executed as "root"

 

Thanks

3 answers

1 accepted

0 votes
Answer accepted
Luca Carducci August 10, 2020

Solved, the user was correct but npm is loaded in the .bashrc file that is ignored from the pipeline's plugin.

I solved adding the npm path to the file /etc/environment

0 votes
Luca Carducci August 8, 2020

I'm using atlassian/ssh-run:0.2.6

this is my code:

image: atlassian/default-image:2
pipelines:
default:
-
step:
deployment: production
script:
-
pipe: atlassian/ssh-run:0.2.6
variables:
SSH_USER: "ubuntu"
SERVER: $HOST
COMMAND: "/home/ubuntu/deploy.sh"
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 10, 2020

@Luca Carducci it depends on your server where you're trying to login and on your ssh key you are using for authentication. If it is root's key , you should be logged in as root. Check your ssh configuration that you have for your "ubuntu" user

0 votes
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 7, 2020

@Luca Carducci tell please which pipe are you using?

And share your pipe usage example

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events