When you import a private key for an SSH connection in the Terminal app, where are those stored? Can I access them?

  • Chris Gerber
    link
    610 months ago

    The key is stored in IndexedDB. You can read more about that at https://developer.chrome.com/docs/devtools/storage/indexeddb.

    It’s not readily available from the Terminal.app UI, but you can get there. Press Ctrl+Shift+I to open the Inspector. Select Application from the top tabs. On the left, under Storage, go to IndexedDB > indexeddb-fs > nassh-rootfs > directory. Look through the list of fullPath entries to find the appropriate entity. In the Value column, locate the data property and click the memory inspector icon to the right of it.

  • @harsh3466
    link
    English
    310 months ago

    Should be in your home directory in the hidden.ssh folder.

    To get there:

    cd ~/.ssh

    • Baron Von JOP
      link
      310 months ago

      That’s where applications in the Linux container will look for them. But in the Terminal app. But I’m talking about SSH connections managed by the Terminal app. In the Identity section of the connection, you can click the Import button and get a file chooser to select a private key file (like by going to Linux files, showing hidden files, and picking a file from ~/.ssh). When you do this Import it copies the file somewhere and when you open the connection it uses that copy. I’m looking for where those copies are stored, because I don’t have a particular key in my ~/.ssh but I want to use it with an sshfs connection.

      • @harsh3466
        link
        English
        110 months ago

        Ah. Apologies. I misunderstood what you were looking for, and unfortunately don’t have an answer to the question.

        • Baron Von JOP
          link
          210 months ago

          Your reply was appreciated none-the-less!

          • @harsh3466
            link
            English
            110 months ago

            Thank you. I hope you get a useful answer!