Google Cloud Platform File Transfer Issues - google-cloud-platform

Issue: Can't transfer files via FileZilla I get an error in the console saying "Permission Denied". I know why I am getting that error. I can't log in as a root user via SFTP because in the username field I have an ssh key that allows me to get into my Google Cloud Platform VM via FileZilla
Edit: What can I do to fix this issue or get around it?

You can refer to this documentation for "Permission denied" issues when uploading files to your vm thru SFTP.
Identify Error
Permission denied errors occur when you don’t have the required permissions to make changes to a file that you’re trying to edit over FTP.
Connect to VM Instance
Connect to your VM instance using the SSH (Linux Shell) terminal.
Check File Permissions
Execute the following command:
stat -c "%a %n" /path/to/file
Edit File Permissions
Run the following command:
sudo chmod 777 /path/to/file

Related

Unable to SSH to Amazon Linux instance from windows 10.I have kept my EC2Tutorial.pem on my desktop. Plz Suggest

I am able to connect to Amazon Ec2 instance but unable to ssh from my windows 10 machine to the Public ip. I am using command :
Attaching supportive screenshots:
1> Path of EC2Tutorial.pem:
2> Command for SSh:
Have followed some of the solutions given by people. chmod 400 EC2Tutorial.pem
also failed with error.
ssh -i EC2Tutorial.pem ec2-user#3.85.176.195
Resulted an error as below:
[ec2-user#ip-172-31-43-19 ~]$ ssh -i EC2Tutorial.pem ec2-user#3.85.176.195
Warning: Identity file EC2Tutorial.pem not accessible: No such file or directory .
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
I am following "Ultimate AWS Certified Developer Associate course on Udemy. and want to ssh the same way as suggested. not getting the same result. plz suggest.enter image description here:
Path to EC2Tutorial.pem file.
enter image description here
CHMOD 400 EC2Tutorial.pem
is a typical linux command to change the permission of the public key,so that it is no longer available for other users to access, in Windows I'm not sure if that is the best idea.
From windows it is recommended that you use an SSH Client like Putty(which is free to use) as that would help setup the configuration. You have to first install Puttygen and change the public *.pem file into a *.ppk file(which you can use in Putty to log in to the server.)
Here is a documentation on how to do that.
AWS Document Link for Using SSH with Putty

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.

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!

How do I configure AMS admin permissions on EC2 AWS?

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.

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.