ssh publickey authenication failing
1 Attachment(s)
Hi
I installed OpenSSH for Windows 10 x64 and followed the instructions to create public and private keys and its stores in my user home folder .ssh. I copied the public key to authorized keys in centos /home/user/.ssh I have also set the sshd_config file correctly to RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys PasswordAuthentication no When I use command prompt and type ssh user@mysite.com it keep saying permission denied with the following error: Code:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic). Code:
C:\Windows\system32>ssh user@mysite.com I attached a picture. Any help on this? thanks |
Which computer is the client and which is the server? If the CentOS computer is the server the public key is saved to the ~/.ssh/authorized_keys file and permission's should be 600.
For windows ssh clients you can use PuTTy or sftp GUI clients WinSCP or Fillezilla. |
Quote:
Server I am connecting to is Centos 6. I did chmod authorized_keys to 600 still giving me the same error... |
Just to make sure you did copy id_rsa.pub to the authorized_keys file on the server?
|
Hi Micheal
This is what I followed: Quote:
|
This is my SSHD config file:
Code:
# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $ And this is how I created the RSA keys: Code:
From the Windows PC |
Did you verify you could connect to the server using passwords?
What you posted should work but from your previous post the key is not being accepted. |
Quote:
https://github.com/PowerShell/Win32-OpenSSH/ Strategically, trademarks and service marks have to be actively defended so given the silence to date, this could end in tears and loss. But take that with a grain of salt since I am neither a lawyer nor involved with the upstream project. |
Quote:
|
Quote:
This is what was recommeneded to install. mls-software.com/opensshd.html It seems to work if I just connect with CMD by password authenication. I just cant seem to figure out why its not working for publickey. I have also tried using PUTTYGEN to generate RSA keys and uploading this to server and connecting via putty with publickey but this is also giving me the exact same error as my original post with permission denied error. Thanks |
bump
|
No need to bump your own post. The forum does it automatically.
|
Almost always this is caused by the permissions of the $HOME/.ssh directory not being 700 = rwx------.
If the directory does not have these exact permissions, and contain an authorized_keys file, and contain the presented key within that file, the certificate will be refused. Also be sure that an "ssh-agent" daemon is running in your session, since this is what manages the presentation of keys to the server. |
Quote:
The home/.ssh folder is set to chmod 700. ssh agent is already running also follwed their steps from below http://www.mls-software.com/opensshd.html thanks |
Also check the permissions on your home folder. 755 or 750 should work, 775 or 770 will cause this failure.
OpenSSH is foremost a security program, and it checks to see if someone other than you can modify files or folders it uses. If it can be modified by other people, it will not trust or use it. Naturally, your HOME and ~/.ssh and contents of ~/.ssh should be owned by you. I see no reason to suspect it might not be, just thought I should mention this. |
All times are GMT -5. The time now is 04:58 PM. |