Comments - MONyog ssh authentication using key

7 years, 10 months ago Sibin AS

Since you are using key based SSH Authentication, you need to generate the ssh key pair first. After generating the key pair, the keys will be copied to ./ssh directory by default ( it is recommended, to use default location, doing so will allow your SSH client to automatically find your SSH keys when attempting to authenticate). The error “Could not get private key:access denied” shows up when the user does not have the permission to read the private key file (you can try changing the directory permission where the file is located and then check)

You may write to support@webyog.com if you have any queries. Sibin (Webyog)

 
7 years, 10 months ago palash harchandani

What if i dont want to share my private key for anyone... Can we do the authorisation using the public key??

 
7 years, 10 months ago palash harchandani

Also i gave permissions 777 to the directory and all the files. When i do ssh in the machine it is working but its not working with MONyog

 
7 years, 10 months ago Sibin AS

You do not have share your private key file. You need to have the private key file on the machine from which you are trying to connect to the remote machine You just need to have/share the public key file intruder to connect to the server.

You may also refer this documentation that will help you with understanding and setting up SSH >> https://www.google.com/url?q=https%3A%2F%2Fwww.digitalocean.com%2Fcommunity%2Ftutorials%2Fhow-to-configure-ssh-key-based-authentication-on-a-linux-server&sa=D&sntz=1&usg=AFQjCNFqzIwxFcwM6An3Gu9U22BvROpnMg

Are you trying to SSH to the machine using the password or using the key? Also try connecting from MONyog to the server using the password based authentication and verify if you are able to connect.

 
7 years, 10 months ago palash harchandani

I am able to connect using the password but not through the key authentication

 
7 years, 10 months ago Sibin AS

Seems like there could be some issue with the key files that you are using. Can you try creating a new SSH key by using the ssh-keygen utility.

On your local computer, generate a SSH key pair by typing, ssh-keygen

and generate the key pair and also specify the file location to save the file. By default the keys will be stored in /.ssh directory. The private key will be called id_rsa and the associated public key will be called id_rsa.pub.

You may refer the below doc that will help you in creating the SSH key >> https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server

Please note, you don’t have to share the private key file. You just have to need the private key file in the machine from which you are trying to connect to a remote machine.

 
7 years, 10 months ago palash harchandani

I created a new ssh key pair itself.. The error is Failed to connect to SFTP: SshConnectAuthorize: Could not get private key -- Access denied. Authentication that can continue: publickey,gssapi-keyex,gssapi-with-mic,password

 
7 years, 10 months ago Sibin AS

Please ensure that you are entering the IP address of the machine where the SSH server is running in the ‘SSH host’ field and enter the SSH username to access the SSH server (not of the MySQL server) in the ‘SSH username’ field.

This is an authentication error. Please make sure that you have entered the correct SSH keys with the required file permission to the key file. We have our FAQ which says how to resolve this issue, here >> http://monyogkb.webyog.com/article/132-authentication-problem-with-key-authentication

 
7 years, 10 months ago palash harchandani

I have checked the permissions and also checked if all the parameters are correct. but still i am getting the same error!!

 
7 years, 10 months ago Sibin AS

Please follow the below steps:

1) Edit PasswordAuthentication line in /etc/ssh/sshd_config to "PasswordAuthentication no" to force RSA auth

2) Change the path for the file “authorized_keys” to some other directory like “/etc/ssh/user/authorized_keys”

3) Make the corresponding change in the “sshd_config” file, and change the value for “AuthorizedKeysFile” to AuthorizedKeysFile = /etc/ssh/user/authorized_keys

4) Restart sshd service (sudo service sshd restart)

Please tell us if this fixed the issue.

 
7 years, 10 months ago palash harchandani

This doesnt solve the problem!!

 
7 years, 10 months ago Sibin AS

Can you please tell what error do you get now.

 
7 years, 10 months ago palash harchandani

Failed to connect to SFTP: SshConnectAuthorize: Could not get private key -- Access denied. Authentication that can continue: publickey,gssapi-keyex,gssapi-with-mic,password

 
7 years, 10 months ago palash harchandani

The problem got solved...Thanks!!

 
7 years, 3 months ago Saksham Ahuja

Could you tell us what was the solution to the issue here?

 
7 years, 10 months ago Sibin AS

Just curious to know what was the issue and how did you get it solved.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.