0
votes

I want to deploy my spring boot application to EC2.

I am using scp command to copy my jar to ec2 var folder,but I get permission denied.

I checked and found that this folder has access to root user only.

Also when I am logged in as ec2-user,I dont have rights to create new folder.

Can you please suggest how as a ec2-user,code can be deployed to Ec2 instance.

1

1 Answers

0
votes

Since you are logging in as ec2-user, I am assuming that you are using one of the aws managed Linux AMI. In these AMIs ec2-user can run commands as root, simply run command as sudo. Eg: sudo mkdir test

You can also switch to root user by using sudo -su root

Please find below link to aws doc for user management https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-users.html