How do I configure AMS admin permissions on EC2 AWS? - amazon-web-services

I created a fresh Adobe Media Server 5 (aka Flash Media Server) instance on Amazon EC2 AWS, I connected over SSH and changed the default password, everything looks ok. But the amsadmin account doesn't seem to have enough access to administrate the instance. I can read most of the files and folders (access denied for /lib; /lost+found and /root).
I can connect ok
ssh -i key.pem amsadmin#public-dns.amazonaws.com
I can upload to the media folder
scp -i key.pem test.f4v amsadmin#public-dns.amazonaws.com:/mnt/applications/vod/media
I can't upload content to webroot; for example if I wanted to add a crossdomain.xml file to the web root.
scp -i key.pem crossdomain.xml amsadmin#public-dns.amazonaws.com:/mnt/webroot/
I can't create a directory; I want to setup S3 to store content, step 5 says to:
Create a directory on the instance to mount the S3 bucket, for example, /mnt/s3fs.
But under the amsadmin account I get an access denied error, is this expected?
How can I get access to these restricted areas?
Update:
I tried executing the commands with sudo and I entered the correct password for amsadmin, got "Sorry, try again".
Do I need to setup a root account?

Figured it out, I needed to run the commands using sudo sh after connecting to the instance via SSH.

Related

Permission denied when connection to ec2 intance, i have given the file permisson 400, but still not working

I have created an ec2-intance on AWS. But when im trying to connect to it by using my .pem file, im getting error message: Permission denied (publickey,gssapi-keyex,gssapi-with-mic). I have changed the permission to this file by chmod 400 myfile.pm.
This is the command i use to connect to my instance: ssh -i ec2demo.pem ec2demo#ec2-35-158-140-25.eu-central-1.compute.amazonaws.com
I also searched for the issue on internet, and some people say i need to type chmod 600 myfile.pem. It still not works. Im using macOS Mojave, and the ssh client integrated. Do i need to install the AWS-CLI to make it works? Or should it work without AWS-CLI? And is it better to use ssh client from homebrew, or?
Thanx for help
When launching a new Amazon Linux instance on Amazon EC2, the public half of the keypair is copied to:
/users/ec2-user/.ssh/authorized_keys
You can then login to the instance using the private half of the keypair:
ssh -i key.pem ec2-user#1.2.3.4
(Or, you can use a DNS name instead of an IP address.)
It sounds like you have not logged into this instance yet, so make sure you login as ec2-user instead of ec2demo. The name of the instance does not impact the Linux user on the instance.

how to change the permission of PEM file in ec2-instance?

I created an ec2-instance with amazon-linux as my OS. I use to connect to the instance using PUTTY. everything was fine. now i changed the permission of some files in the instance to 0777 using chmod command. by mistake the permission of .pem file in the instance also got changed and i'm not able to connect the insatnce . getting error like Permission denied (public key).Is there any way to change the permission of .pem file in the ec2-instance ?
If you cant log in with the root user, nor any other user who could then elevate their privileges to root, you've probably bricked the machine. I dont believe, for example, Amazon will even retain a backdoor into the VM.

permission denied (publickey) - AWS EC2

I am trying to get a Django app running on Amazon EC2. I currently have my .pem file saved in the root of my Django project.
When I try this
chmod 600 oby.pem
ssh -i oby.pem ubuntu#52.0.215.90
in my mac terminal, I receive this error: Permission denied (publickey).
To begin, am I saving the my oby.pem file in the right location? If not, where should it go?
Furthermore, what are the necessary steps to correctly set up the ssh key?
Thank you!

couldn't get root access to aws ec2

I'm trying to access aws instance using ssh with private keys downloaded from aws.
I got access using ec2-user which their documentation suggested.
$ ssh -i upd_prayag.pem ec2-user#ec2-54-209-155-100.compute-1.amazonaws.com
Apparently, I find two users there,
ec2-user
prayagupd
What I want is ls the user prayagupd to check whether the directory I have cloned from github exists there.
Unfortunately I see permission denied message on that user.
I get Permission denied (publickey) on
$ sudo ssh -i upd_prayag.pem ec2-user#ec2-54-209-155-100.compute-1.amazonaws.com
They suggest sudo su - should work but it has been asking password, some of the links I found through google is making me anxious that I can't get root access.
Reference
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
If the instance is created from an AWS image, then you cannot get root access.

Download file from AWS EC2 instance to local host

I'm trying to download access logs from an AWS EC2 instance to my local machine using the following command:
scp -i private-key.pem ec2-user#ec2-public-dns-address:/path/to/filename
But I keep getting an error saying "Permission Denied" (rather than "Permission Denied (publickey)"). Any idea what's wrong?
Most probably, you are trying to download a file, to which your default user doesn't have access. Example: downloading a db dump from /tmp/dump/ to which only root user has access.
If that is the case, ssh on the instance, move/copy the file to a location accessible for your user, and make it the owner of the file, and then ssh out and scp.