0

I have been trying to add my SSH keys to the ssh-agent by following the directions on this GitHub doc: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key

This is what I put into the terminal:

  • root@Nicoles-MacBook-Air nicoletr # eval "$(ssh-agent -s)"

    Agent pid 21417

    root@Nicoles-MacBook-Air nicoletr # open ~/.ssh/config

    The file /var/root/.ssh/config does not exist.

    root@Nicoles-MacBook-Air nicoletr # touch ~/.ssh/config

    root@Nicoles-MacBook-Air nicoletr # open ~/.ssh/config

But when I hit enter to open the ~/.ssh/config file, the TextEdit app opens instead of a text file that I can modify. I am supposed to modify the config text file but I don't even see any file at all. I am still very new to coding so I would be extremely grateful for any guidance.

nicotr
  • 1
  • 2

1 Answers1

0

Open command

On MacOS, the open command will open file in parameter with the default configured application for this filetype (such as Preview, TextEdit or Safari for some others)

Even though you can override which application is used to open the file, there are more standard solutions to achieve this.

For the sake of completeness, you can override default app by using -a option, for example, if you want to open an html file with TextEdit instead of Safari by default:

open -a TextEdit page.html

More information about open:

Alternative

If you would like to edit any file directly from your terminal, you can use packages such as nano, to easily get started with it you can check this article. As an added bonus, it also go through setting brew to easily install package, also from your terminal

There are alternatives to nano (like vi, vim) and to brew (such as macports). They all have their pros and cons depending on the use, though in you case, I don't think your need would justify the steeper learning curve yet

Happy discovering coding !

Bleacks
  • 31
  • 4