Operating System - HP-UX
1833824 Members
2290 Online
110063 Solutions
New Discussion

Re: sshd2 connection problem in Unix-windows machine

 
vinodan
Advisor

sshd2 connection problem in Unix-windows machine

I am trying to connect to a windows ssh server from unix machine . Error encountered is as follows


UNIX MACHINE-username >> ssh username@windowsmachine.xyz.com

Permission denied (publickey).

UNIX MACHINE username >>


Recently a password change is happened in windows machine . will this cause this problem . I guess it won't ...

can some one help me out


Thanks in advance
1 REPLY 1
Matti_Kurkela
Honored Contributor

Re: sshd2 connection problem in Unix-windows machine

Apparently the unix machine is configured to accept SSH key authentication only. If it does not get a correct key, it won't even ask for a password: it just sends a "Permission denied (publickey)" and closes the connection.

Your unix user should have the correct SSH key available, otherwise this connection won't work. If there is no key, you should create a key using the "ssh-keygen" command on the unix machine.

A SSH key has two parts: a private part and a public part. After the key is generated, you should send a copy of the public part to the administrator of the windows machine, so that he/she can add it to the list of accepted keys for that particular windows user account.

For OpenSSH (including HP SSH), the private key should be located in ~/.ssh/id_rsa or ~/.ssh/id_dsa, depending on whether the key type is RSA or DSA. The public key is ~/.ssh/id_rsa.pub or ~/.ssh/id_dsa.pub, respectively.

The key files must have -rw------- (chmod 600) protection, and the .ssh subdirectory must have drwx------ (chmod 700) protection. The user's home directory must not be writeable for anyone other than the user: the maximum permissions for it are drwxr-xr-x (chmod 755). If these conditions are not met, the unix ssh won't use the key because someone else may have tampered with it.

If you are using ssh.com client in your unix machine, the sub-directory may be ~/.ssh2 instead of ~/.ssh and the key files have different names.

If these tips won't help you, please try connecting again using the -v option with the ssh command:

ssh -v username@windowsmachine.xyz.com
or for maximum information
ssh -vvv username@windowsmachine.xyz.com

With these options, the ssh client will display a lot of information. By analyzing it, it's possible to identify what goes wrong in the SSH connection.

MK
MK