Where is the known_hosts file for OpenSSH for Windows?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







15















One of the servers I frequently log into via SSH has changed it's IP address. So, now I'm getting man in the middle attack warnings when I try to use SSH via Windows Powershell and OpenSSH for Windows.



On a linux machine, I would just remove the offending line from ~/.ssh/known_hosts. But, the ~/.ssh directory seems to be empty.



Where is the known_hosts file for Powershell/OpenSSH? I've checked in C:Program FilesOpenSSHhomeanschauung.ssh, but that folder is empty as well.










share|improve this question























  • Don't remove it. Update the line to change the IP address from the old one to the new one to avoid opening a window for an attacker to impersonate the host.

    – Curt J. Sampson
    Dec 12 '16 at 2:07


















15















One of the servers I frequently log into via SSH has changed it's IP address. So, now I'm getting man in the middle attack warnings when I try to use SSH via Windows Powershell and OpenSSH for Windows.



On a linux machine, I would just remove the offending line from ~/.ssh/known_hosts. But, the ~/.ssh directory seems to be empty.



Where is the known_hosts file for Powershell/OpenSSH? I've checked in C:Program FilesOpenSSHhomeanschauung.ssh, but that folder is empty as well.










share|improve this question























  • Don't remove it. Update the line to change the IP address from the old one to the new one to avoid opening a window for an attacker to impersonate the host.

    – Curt J. Sampson
    Dec 12 '16 at 2:07














15












15








15


4






One of the servers I frequently log into via SSH has changed it's IP address. So, now I'm getting man in the middle attack warnings when I try to use SSH via Windows Powershell and OpenSSH for Windows.



On a linux machine, I would just remove the offending line from ~/.ssh/known_hosts. But, the ~/.ssh directory seems to be empty.



Where is the known_hosts file for Powershell/OpenSSH? I've checked in C:Program FilesOpenSSHhomeanschauung.ssh, but that folder is empty as well.










share|improve this question














One of the servers I frequently log into via SSH has changed it's IP address. So, now I'm getting man in the middle attack warnings when I try to use SSH via Windows Powershell and OpenSSH for Windows.



On a linux machine, I would just remove the offending line from ~/.ssh/known_hosts. But, the ~/.ssh directory seems to be empty.



Where is the known_hosts file for Powershell/OpenSSH? I've checked in C:Program FilesOpenSSHhomeanschauung.ssh, but that folder is empty as well.







ssh powershell






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jul 18 '11 at 12:18









anschauunganschauung

3483517




3483517













  • Don't remove it. Update the line to change the IP address from the old one to the new one to avoid opening a window for an attacker to impersonate the host.

    – Curt J. Sampson
    Dec 12 '16 at 2:07



















  • Don't remove it. Update the line to change the IP address from the old one to the new one to avoid opening a window for an attacker to impersonate the host.

    – Curt J. Sampson
    Dec 12 '16 at 2:07

















Don't remove it. Update the line to change the IP address from the old one to the new one to avoid opening a window for an attacker to impersonate the host.

– Curt J. Sampson
Dec 12 '16 at 2:07





Don't remove it. Update the line to change the IP address from the old one to the new one to avoid opening a window for an attacker to impersonate the host.

– Curt J. Sampson
Dec 12 '16 at 2:07










2 Answers
2






active

oldest

votes


















16














On windows it is usually stored in the %USERPROFILE%ssh or %USERPROFILE%.ssh folders. If you type %USERPROFILE% into the Windows explorer address bar it will be expanded automatically. You can also try cd /d "%USERPROFILE%ssh" or cd /d "%USERPROFILE%.ssh" from a command prompt.






share|improve this answer

































    4














    Had a similar issue not fixed with the user profile's known_hosts, so for anyone looking: If you have installed git, TortoiseGit, etc on Windows, the location of the overriding known_hosts file is in your git folder, e.g. Programs/Git/.ssh or Programs (x86)/Git/.ssh.



    As per the error message



    Add correct host key in /.ssh/known_hosts to get rid of this message.
    Offending key in /.ssh/known_hosts:1


    open the known_hosts file in an editor like Sublime with admin rights, remove the corresponding entry for your server in Programs/Git/.ssh/known_hosts and the new key fingerprint will get added on the next connection.






    share|improve this answer
























    • For me: C:Users[My User]AppDataLocalVirtualStoreProgram Files (x86)Git.ssh

      – Dunc
      Sep 7 '15 at 11:05












    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f311886%2fwhere-is-the-known-hosts-file-for-openssh-for-windows%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    16














    On windows it is usually stored in the %USERPROFILE%ssh or %USERPROFILE%.ssh folders. If you type %USERPROFILE% into the Windows explorer address bar it will be expanded automatically. You can also try cd /d "%USERPROFILE%ssh" or cd /d "%USERPROFILE%.ssh" from a command prompt.






    share|improve this answer






























      16














      On windows it is usually stored in the %USERPROFILE%ssh or %USERPROFILE%.ssh folders. If you type %USERPROFILE% into the Windows explorer address bar it will be expanded automatically. You can also try cd /d "%USERPROFILE%ssh" or cd /d "%USERPROFILE%.ssh" from a command prompt.






      share|improve this answer




























        16












        16








        16







        On windows it is usually stored in the %USERPROFILE%ssh or %USERPROFILE%.ssh folders. If you type %USERPROFILE% into the Windows explorer address bar it will be expanded automatically. You can also try cd /d "%USERPROFILE%ssh" or cd /d "%USERPROFILE%.ssh" from a command prompt.






        share|improve this answer















        On windows it is usually stored in the %USERPROFILE%ssh or %USERPROFILE%.ssh folders. If you type %USERPROFILE% into the Windows explorer address bar it will be expanded automatically. You can also try cd /d "%USERPROFILE%ssh" or cd /d "%USERPROFILE%.ssh" from a command prompt.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 31 at 19:07

























        answered Aug 3 '11 at 22:04









        ccpizzaccpizza

        4,02733441




        4,02733441

























            4














            Had a similar issue not fixed with the user profile's known_hosts, so for anyone looking: If you have installed git, TortoiseGit, etc on Windows, the location of the overriding known_hosts file is in your git folder, e.g. Programs/Git/.ssh or Programs (x86)/Git/.ssh.



            As per the error message



            Add correct host key in /.ssh/known_hosts to get rid of this message.
            Offending key in /.ssh/known_hosts:1


            open the known_hosts file in an editor like Sublime with admin rights, remove the corresponding entry for your server in Programs/Git/.ssh/known_hosts and the new key fingerprint will get added on the next connection.






            share|improve this answer
























            • For me: C:Users[My User]AppDataLocalVirtualStoreProgram Files (x86)Git.ssh

              – Dunc
              Sep 7 '15 at 11:05
















            4














            Had a similar issue not fixed with the user profile's known_hosts, so for anyone looking: If you have installed git, TortoiseGit, etc on Windows, the location of the overriding known_hosts file is in your git folder, e.g. Programs/Git/.ssh or Programs (x86)/Git/.ssh.



            As per the error message



            Add correct host key in /.ssh/known_hosts to get rid of this message.
            Offending key in /.ssh/known_hosts:1


            open the known_hosts file in an editor like Sublime with admin rights, remove the corresponding entry for your server in Programs/Git/.ssh/known_hosts and the new key fingerprint will get added on the next connection.






            share|improve this answer
























            • For me: C:Users[My User]AppDataLocalVirtualStoreProgram Files (x86)Git.ssh

              – Dunc
              Sep 7 '15 at 11:05














            4












            4








            4







            Had a similar issue not fixed with the user profile's known_hosts, so for anyone looking: If you have installed git, TortoiseGit, etc on Windows, the location of the overriding known_hosts file is in your git folder, e.g. Programs/Git/.ssh or Programs (x86)/Git/.ssh.



            As per the error message



            Add correct host key in /.ssh/known_hosts to get rid of this message.
            Offending key in /.ssh/known_hosts:1


            open the known_hosts file in an editor like Sublime with admin rights, remove the corresponding entry for your server in Programs/Git/.ssh/known_hosts and the new key fingerprint will get added on the next connection.






            share|improve this answer













            Had a similar issue not fixed with the user profile's known_hosts, so for anyone looking: If you have installed git, TortoiseGit, etc on Windows, the location of the overriding known_hosts file is in your git folder, e.g. Programs/Git/.ssh or Programs (x86)/Git/.ssh.



            As per the error message



            Add correct host key in /.ssh/known_hosts to get rid of this message.
            Offending key in /.ssh/known_hosts:1


            open the known_hosts file in an editor like Sublime with admin rights, remove the corresponding entry for your server in Programs/Git/.ssh/known_hosts and the new key fingerprint will get added on the next connection.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 11 '15 at 9:04









            speedracrspeedracr

            1411




            1411













            • For me: C:Users[My User]AppDataLocalVirtualStoreProgram Files (x86)Git.ssh

              – Dunc
              Sep 7 '15 at 11:05



















            • For me: C:Users[My User]AppDataLocalVirtualStoreProgram Files (x86)Git.ssh

              – Dunc
              Sep 7 '15 at 11:05

















            For me: C:Users[My User]AppDataLocalVirtualStoreProgram Files (x86)Git.ssh

            – Dunc
            Sep 7 '15 at 11:05





            For me: C:Users[My User]AppDataLocalVirtualStoreProgram Files (x86)Git.ssh

            – Dunc
            Sep 7 '15 at 11:05


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f311886%2fwhere-is-the-known-hosts-file-for-openssh-for-windows%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            RAC Tourist Trophy