Obtaining root access on ec2

I am trying to write to my / var / www / folder on my apache server, which I configure on EC2. All permissions are set to the "root" user, but amazon only allows you to log in to the AMI as "ec2-user".

I am using WinSCP. I logged in as user ec2 using ssh and executed sudo su, so I can get root access this way. But how do I get the same access through my SFTP (WinSCP) as well as through putty?

Thanks!

+4
source share
2 answers

When you connect to SSH, you can su to the root user if necessary.

As for FTP and SCP, it looks like you want your www folder to belong to the user you are going to register with, not root.

This is your server, you manage all permissions and can create as many users as you want.

+3
source

Add the ec2 user to the user group to which your root file belongs (the group to which your Apache user belongs) Now you can safely WinSCP or SFTP.

+2
source

Source: https://habr.com/ru/post/1342173/


All Articles