OpenSSH and network drives on Windows

I’m using OpenSSH 3.x on all servers both Windows and Linux / Unix and Macs as well to remotely access files and services. With OpenSSH for Windows I faced with the following error:


C:\unix\Console2>ssh servername.hu -l balint
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/cygdrive/x/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /cygdrive/x/.ssh/id_rsa
Enter passphrase for key '/cygdrive/x/.ssh/id_rsa':

This is of course not the way it should be - it should normaly authenticate with the keyfiles; however on Windows we don’t have chmod to change the permissions. It turned out, that NT rights are not successfuly loaded with Cygwin, if your files are on a network drive - and X: is a remote server for me.

So - instead of running unnecessary circles: we can change the CYGDRIVE and the CYGPATH variables (even temporarily) to check our .ssh folder on a local path:


set CYGDRIVE=c:
set CYGPATH=\unix

copy x:\.shh c:\unix\.shh

And voila:


C:\unix\Console2>ssh servername.hu -l balint
Last login: Mon Mar 19 17:11:58 2007 from xx.xx.xx.140
[balint@servername.hu ~]$

2 Responses to “OpenSSH and network drives on Windows”

  1. jason says:

    I can’t seem to get ssh to see my keys… no matter where I put them unless I tell it where they are. Problem is when yo are trying to use rsync over ssh you can’t tell ssh where the keys are.

    I tried your solution and ssh still asks me for a password.

    Any Ideas what might be going on?

  2. Scott says:

    Hi Jason

    Turn on verbose output for ssh. So “ssh -vv user@host”. It might help you find the problem.

    Scott

Leave a Reply