Permission key denied in Azure - azure

I created a virtual machine on Azure. It was working fine a couple of days ago (I was able to connect to it using SSL using command prompt), after that I reserved the IP public address and shutdown the machine and . Now I am trying to connect to it via SSL using same way and it is throwing permission denied error. How to rectify this ?
ssh -i user_key.pem username#xx.xxx.xx.xx
Load key "user_key.pem": Permission denied
username#xx.xxx.xx.xx: Permission denied (publickey).

The problem was that I removed all permissions (except read by administrator) from my key.pem file. This I did because previously it was showing that the permissions are too open.
Opening the command prompt as administrator mode worked.

Related

Getting error while launching a SSH session Permission denied (publickey)

Getting below error while launching ssh sesssion, I have all my public keys in place in both the places
1./username/.ssh/authorizedkeys
2.trusted-user-ca.keys.pem
Still getting below error.
" Warning: Permanently added 'XX.XX.XX.XXX' (ECDSA) to the list of known hosts. Permission denied (publickey).
can anyone help on this?
First you have to change file permission like this
chmod 400 key.pem
then use
ssh -i "key.pem" root#domain.amazonaws.com
Issue was with the public certificate, The principal name was different from the user name, tried signing the user public key with username as principal and I successfully logged in.

key issues : aws EC2-instance

I am facing some login problem for accessing instance. While login to the server console (its a live server) it shows as Permission denied (publickey), Also am accessing with sudo also same issue persists. AWS instance, should reboot, no change while login issue persists.
As explained in AWS docs your key needs correct permissions:
If you are connecting from MacOS or Linux, run the following command to fix this error, substituting the path for your private key file.
chmod 0400 .ssh/my_private_key.pem
If you got a public key when you set up the server and you saved it (.pem file), you first need to change permissions to it. If in Linux cd to the directory holding the .pem file, then do this:
chmod 400 /path/to/your_public_key.pem for only-read permission.
Then with your EC2 instance public DNS ( get it in AWS EC2 console when you click on your instance ID) which is similar to ec2-x-xxx-xx.us-east-3.compute.amazonaws.com ,you can ssh into your server as follows. Assuming your user account name in the server is ubuntu like in most of the Linux based AMIs in AWS, do:
ssh -i your_public_key.pem ubuntu#ec2-x-xxx-xx.us-east-3.compute.amazonaws.com and if prompted for a password, provide it.
Good luck:)

Connecting Azure Linux VM having Ubuntu installed from powershell throwing Host Verification failed. . . error

I tried to connect to Azure Linux VM where Ubuntu installed from https://shell.azure.com/bash
ssh username#ipaddress
above command is throwing error as Permission Denied (publickey) .
I have created SSH public key and added it to VM while creating Azure Linux VM following below article.
https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal
But still facing Permission Denied issue.
Also, I tried to run bolt command on Azure Linux VM remotely from another windows machine powershell.
I got error as below
Host key verification failed for '10.20.30.40':fingerprint
SHA256:mssgkeghbfnb9883yygebwndjhk is unknown for '10.20.30.40'
How to fix above issues. Kindly suggest.
Permission denied (publickey) means that your public key is not in the authorized_keys file. Copy the public key manually to that user's ~/.ssh/authorized_keys file, or use ssh-copy-id which comes with OpenSSH.
Also, make sure you're SSH'ing to the right user with ssh user#host

AWS - Access the volume and fix own of the folders

My server was perfect until I used some chown commands.
So after that I even could not connect via putty or FTP.
I received:
Server refused our key.
So then I created a new instance and attached my volume to it.
I had mounted the volume but i cannot access anything because every folder is permission denied
What should I do? It is getting me crazy!
Change the user from 'ec2-user' to 'root' using sudo su and then you will be able to access all the directories.

FTP getting 550 Permission denied Apache Ubuntu Server 11

I just set up FTP today, and I am getting a 550 Permission denied error.
I tried chmod-ing the directory(/var/www/site1).
Any ideas?
Check if your username and password is correct and port number.
the other reason can be you may not be having the permission to use the ftp in your network.
I had the same error message transferring files from the server to my laptop. I changed the firewall settings to allow the server IP address. The error no longer appears.
In my case changing the chmod permissions did not affect it.

Resources