cygport upload seems to ignore SSH_KEY
Norton Allen
allen@huarp.harvard.edu
Wed Dec 18 21:20:09 GMT 2024
On 12/18/2024 3:37 PM, Federico Kircheis via Cygwin wrote:
> On 18/12/2024 20.38, Eliot Moss wrote:
>> On 12/18/2024 2:30 PM, Federico Kircheis via Cygwin wrote:
>>> On 05/11/2024 18.31, Federico Kircheis wrote:
>>>> On 05/11/2024 18.29, ASSI via Cygwin wrote:
>>>>> Federico Kircheis via Cygwin writes:
>>>>>> I also did a chmod/chown on the file to ensure that the permission
>>>>>> where correct.
>>>>>> The file with the permission unchanged worked without issues when
>>>>>> moved in ~/.ssh.
>>>>>
>>>>> Whatever directory that file resides in must be readable only by the
>>>>> owner or SSH will not use it.
>>>>>
>>>>>
>>>>> Regard,
>>>>> Achim.
>>>>
>>>> Mhm, that could be it.
>>>> I did not try to modify the permission of the directory.
>>>
>>>
>>> Nope.
>>>
>>> Directory has permission 0700, file has permission 0600, just to be
>>> sure I've execute chmod on both.
>>> I can access they key but I still experienced the issue
>>>
>>> ~~~~
>>> $ ls -la $SSH_KEY
>>> -rw-------+ 1 Administrators None 3357 Dec 20 2019 /cygdrive/c/
>>> cygport-ps/ssh/id_rsa_cyg
>>>
>>> $ ls -la /cygdrive/c/cygport-ps/ssh/
>>> total 13
>>> drws--S---+ 1 Administrators None 0 Jan 14 2023 .
>>> drwxrwx---+ 1 Administrators None 0 Dec 18 10:55 ..
>>> -rw-------+ 1 Administrators None 3357 Dec 20 2019 id_rsa_cyg
>>> -rw-------+ 1 Administrators None 745 Jul 25 2018 id_rsa_cyg.pub
>>> -rw-------+ 1 Administrators None 236 Mar 18 2020 known_hosts
>>> ~~~~
>>>
>>> If I manually execute lftp
>>>
>>>
>>> ~~~~
>>> $ lftp sftp://cygwin:@cygwin.com
>>> lftp cygwin@cygwin.com:~> cd .
>>> cd `.' [Connecting...]
>>> ~~~~
>>>
>>> and hangs.
>>>
>>> I'm not sure how to debug the issue further, and the relation
>>> between all tools.
>>>
>>> ~~~~
>>> $ sftp sftp://cygwin:@cygwin.com
>>> cygwin:@cygwin.com: Permission denied (publickey).
>>> Connection closed
>>> ~~~~
>>>
>>> I guess lftp/sftp does not support the variable SSH_KEY, as I get
>>> the same "Permission denied (publickey)." error with "ssh -v sftp://
>>> cygwin:@cygwin.com", and I see that there is no attempt to use my
>>> ssh key
>>>
>>> Also following command does not report an error:
>>>
>>> ~~~~
>>> sftp -i $SSH_KEY sftp://cygwin:@cygwin.com
>>> Connection closed by 8.43.85.97 port 22
>>> Connection closed
>>> ~~~~
>>
>> Curious. I'm not an expert, but I tend to put info in my ssh config
>> file. Does that help here?
>>
>> And, probably grasping at straws, are you sure SSH_KEY is exported :-) ?
>>
>> Some people who are more expert might have better suggestions ...
>> Eliot Moss
>>
>
> Yes, I'm sure it is exported, and currently even copying the file in
> .ssh does not work, which did work last time (I get the exact same
> behavior), thus ATM I'm unable to push an update.
>
> Maybe an issue server-side?
>
As far as I know, neither sftp nor ssh support the environment variable
SSH_KEY, but if you are passing it on the command line as below, it
doesn't need to.
Have you tried adding the '-v' option to report verbose status? That
will let you know if it is trying to use the specified key.
More information about the Cygwin
mailing list