镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Console output needs to be platform sensitive #469

Open

Description

Certain parts of OpenSSh core code needs to be refactored to take into account any output that is platform sensitive. Examples of inaccurate output on Windows

  • ssh-keygen
Enter file in which to save the key (C:\Users\nwelna/.ssh/id_rsa):
  • ssh
Add correct host key in C:\\Users\\manojamp/.ssh/known_hosts to get rid of this messag

Activity

  1. added this to the milestone on Mar 29, 2017
  2. removed this from the milestone on May 21, 2019
  3. scottmwyant commented on Oct 10, 2021

    @scottmwyant

    Do we need to open an issue for this in the other repo, https://github.com/PowerShell/openssh-portable/issues? I'm still seeing this issue. It appears to be a little more severe in my case. Working on gathering information.

    It appears to work but doesn't actually create the key in the stated directory, or anywhere at all as far as I can tell!

    C:\Users\scott>ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (C:\Users\scott/.ssh/id_rsa): smw_gh
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in smw_gh.
    Your public key has been saved in smw_gh.pub.
    The key fingerprint is:
    SHA256:ykkwb+tM+aEluDKxkwASqgRI1hxX1JhhZvAHPGKOXzg scott@INSPIRON7347
    The key's randomart image is:
    +---[RSA 3072]----+
    |ooo..o=O=        |
    |=  o.o==..       |
    |o.  * o...       |
    |+. . E ..        |
    |=   . * S        |
    |o .  * =         |
    | . +. O o        |
    |  *  = = .       |
    |   +. + .        |
    +----[SHA256]-----+
    
    C:\Users\scott>

    Then in a new cmd window

    Microsoft Windows [Version 10.0.19043.1165]
    (c) Microsoft Corporation. All rights reserved.
    
    C:\Users\scott>cd .ssh\id_rsa
    The system cannot find the path specified.
    
    C:\Users\scott>
    
    

    So I tried to provide a path, but that resulted in an error: No such file or directory.

    C:\Users\scott>ssh-keygen
    Generating public/private rsa key pair.
    Enter file in which to save the key (C:\Users\scott/.ssh/id_rsa): C:\users\scott\.ssh\id_rsa\smw_gh
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Saving key "C:\\users\\scott\\.ssh\\id_rsa\\smw_gh" failed: No such file or directory

    Same issue on two different machines so far.

  4. NoMoreFood commented on Oct 10, 2021

    @NoMoreFood

    In your first example, I believe the files were saved as smw_gh since C:\Users\scott was your current directory:

    C:\Users\scott\smw_gh
    C:\Users\scott\smw_gh.pub
    

    In your second example, my guess is the directory C:\users\scott\.ssh\id_rsa does not exist. The default, C:\users\scott.ssh\id_rsa, is not a directory; it's the full path to a single file under C:\Users\scott\.ssh.

  5. scottmwyant commented on Oct 10, 2021

    @scottmwyant

    Got it. They were in my user folder like you suggested. Didn't know that was a file path either. Figured it would create the directory if it didn't exist. I'm good now. Any yes, I deleted those keys and re-ran the command ;).

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions