Как найти файл ssh mac os

Looks like no one’s replied in a while. To start the conversation again, simply

ask a new question.

Where is the .ssh folder OR where do I put my ssh key so I can use it in Terminal?

I administer (on a basic level) a few VPSs running Linux. I’ve usually done that by connecting to the VPS via SSH from terminal. In the older version of OS X like High Sierra, on my older MacBook Pro, I could find the .ssh folder in Users, and I could place my key, id_rsa and edit known_hosts.

With the new version of OSX, Big Sur, my keys still work on a MacBook Air I have that was upgraded. ( I see I am know using zsh in Terminal.) But, I have a new-to-me MacBook Air to which I want to add my key. I can’t find the .ssh folder anymore. In Finder, I have hit option and looked under the Go menu. I can see the hidden User Library folder, but I can’t find anything related to SSH.

How do I get my keys into Terminal on Big Sur?

MacBook Air

Posted on Feb 16, 2021 4:41 AM

For your upgraded MacBook, the keys should be in /Users/<username>/.ssh. Spotlight will not find these files.

For your «new to you» MacBook, the .ssh directory may not exist by default. From your new MacBook, either log into your Linux system using ssh or create the .ssh directory manually. You can then move your key files to the new MacBook from the old one.

As an alternative to try to find those files, open a Terminal window and execute the following command:

find . -name ‘id-rsa*’ -print

Posted on Feb 16, 2021 8:59 AM

Similar questions

  • Terminal SSH not showing full path on remote server
    Hi,

    I just updated to macOS 16 and now when I ssh into a host, it doesn’t show me the file path of my current working directory. This used to be the default behavior. Does anybody know how to get it back? (where the $ is there used to be the username and the cwd)

    142
    1

  • ssh shortcuts help
    I can open the Terminal app on my iMac and MacMini and SSH to my raspberrypi with no problems; connecting or running commands. However when i try to use the Shortscuts app and «Run over SSH» using user and password inputs I get the Error «Run Script Over SSH could not connect to the SSH server.» I have been searching for hours for any direction to help correct. Does anyone have any ideas on how to correct?

    1657
    4

  • What is the proper location for sshd_config?
    I’m running both El Capitan and High Sierra on various boxes. I’ve been doing a lot of systems setup, backup, copying, etc. and wanted to configure password-less operation of ssh between these machines. I understand the process of setting up password-less ssh operations having done this before (on macOS and non-macOS systems) … and everything I’ve done so far is working perfectly fine (as far as I can tell) … but I don’t know why it’s working!All the online (macOS) documentation that I read regarding this process mentions tweaks that should be made to the daemon configuration file: /etc/sshd_config However, that file does not exist! I do have the file /etc/ssh/sshd_config (and a whole lot of other stuff in that directory) but no ssh-related files in /etc.These online sources say that I need to make the following changes to /etc/sshd_config:RSAAuthentication yesPubkeyAuthentication yesPermitRootLogin noPasswordAuthentication noPermitEmptyPasswords noChallengeResponseAuthentication noI’ve never made a single one of these changes — because there is no /etc/sshd_config in El Capitan or High Sierra — yet everything works as expected. I’m very confused. Can someone enlighten me?Thanks!

    972
    1

Where is the .ssh folder OR where do I put my ssh key so I can use it in Terminal?

I have tried the following steps from How to access my .ssh folder for Transmit or Cyberduck?:

In the find file window, press Command-Shift-G. It’ll ask you what folder to navigate to. Enter «~/.ssh» and press return.

… but I did not get any reply. The screen remains the same. What am I doing wrong?

nohillside's user avatar

nohillside

94.3k40 gold badges201 silver badges247 bronze badges

asked Dec 22, 2018 at 13:59

Goutham Mailvahanan's user avatar

1

You might need to create the folder first. For this, open Terminal and run

mkdir ~/.ssh; chmod 700 ~/.ssh

Also, when entering ~/.ssh in the dialog shown after pressing Shift-Cmd-G it’s important to enter the string without the "":

enter image description here

answered Dec 22, 2018 at 15:07

nohillside's user avatar

nohillsidenohillside

94.3k40 gold badges201 silver badges247 bronze badges

1

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

In macOS, you need to generate your public and private keys from the Terminal. If you haven’t yet done this, the .ssh directory will not exist. To create them:

Open the terminal App and enter the following command:

ssh-keygen

You’ll get a prompt to choose the location for the keys. It
will say “Enter file in which to save the key
(/Users/your-username/.ssh/id_rsa)”
. If you’re happy with the default location(~/.ssh/) just tap Return. Within your shell the ~ character is equivalent to /Users/your-username/. It stands for your home directory.

It will now say “Enter passphrase (empty
for no passphrase):”
. Enter your passphrase and press Return. You are
asked to re-enter the password to confirm you typed it correctly. This passphrase is used to encrypt the private key and it’s recommended you set one.

The prompt will now say “Your identification has been saved in
/Users/your-username/.ssh/id_rsa”
and “Your public key has been saved in
/Users/your-username/.ssh/id_rsa.pub.”
It’ll then show you the key’s Fingerprint and Randomart. The Fingerprint matches the public
key and can be used in some situations for authentication, and the
Randomart file is designed to match the Fingerprint but be easier to
visually identify that it is the right key. You don’t need to copy these down for most purposes.

Now you can view the newly-created .ssh directory and find your key within.

You can find a pretty readable guide on the subject here.

Edit: If you want to copy in previously-saved public and private keys:

  • In the terminal, enter cd ~
  • Then mkdir .ssh; chmod 700 ~/.ssh

This will create the directory and give it adequate permissions. Within this directory, you can now paste in your two files which contain the matching public and private key pair. These will be your id_rsa.pub and id_rsa files respectively. Once this is done, double-check their permissions are what they need to be by running:

ls -l ~/.ssh/id_rsa*

The output should look like this(except the numbers 1766 and 388):

-rw------- 1 user root 1766 Oct 04  2017 .ssh/id_rsa
-rw-r--r-- 1 user root  388 Oct 04  2017 .ssh/id_rsa.pub

In case you get something that doesn’t look like this, set the permissions of these files with:

$ chown user:user ~/.ssh/id_rsa*
$ chmod 600 ~/.ssh/id_rsa
$ chmod 644 ~/.ssh/id_rsa.pub

Note that with chown user:user ~/.ssh/id_rsa* just above, user is the user account you’re logged in with, not literally «user».

To locate .ssh in High Sierra, and possibly even up to the latest macOS, do the following:

  1. Navigate to your boot disk in finder… usually Macintosh HD, disk1, or whatever it’s named.

  2. From there, hold down Shift Cmd .. This will reveal hidden files, and the goal at this point is to simply do that. If this command doesn’t work for you, find out if there are any new commands that do that for your macOS version. For me, on High Sierra, this command works perfectly.

  3. After that, grey files should appear. Click on the users folder, then click on your user, whatever you named it. Maybe you named it, Tom, Jake, or whatever, but your user should be in this users folder.

  4. After clicking it, scroll up until you see the folder named .ssh. It should also be greyed out because it’s hidden.

  5. If you are not able to find it, then to make sure that you don’t have it and you are just not a very good searcher, go to your terminal app and run the following command: cd .ssh. This command will immediately bring you into the folder if it exists, and if you want to add stuff to it manually, I advise against it for now.

  6. If you do the above command and it gives you some kind of error such as no such directory or something like that, it means you don’t have that folder for real.

  7. There are other things you can do to find out for sure if you even have ssh capacity on your computer.

  8. Navigate back to your disk

  9. Along side the users folder, there should another folder named etc. This folder should be greyed out.

  10. Click it. Once you are there, you should have an ssh folder named ssh. Click it, and it should contain three folders: moduli, ssh_config, and sshd_config. If it has more, it’s fine, but it must have these three folders.

  11. If you don’t find these folders or even the ssh folder, then you probably don’t have ssh capacity, or maybe these folders are located somewhere else. To make sure, I would do a search in Finder for these two folders, .ssh or ssh.

  12. I mentioned that you shouldn’t try to edit any of these folders or files without knowing exactly what you are doing and what it will do because ssh will literally create new folders itself. When you generate a new connection, ssh will add that into another file named know_hosts under the .ssh folder. If you modify these names without knowing what they do, you could ruin your capacity to even create new connections, and such.

Anyway, research this issue further to be certain. And this is all I know about ssh on macOS High Sierra.

Спасибо за помощь, но в каталогах MAC, в тех папках, где указано в терминале, ничего похожего нет. Везде пишут «скопируйте файл», но его там нет.

Написано

более трёх лет назад

Понравилась статья? Поделить с друзьями:
  • Как найти тепло изоляции
  • Как правильно составить договор с самозанятым чтобы его не переквалифицировали в трудовой
  • Как найти сюжет для фотографии
  • Как составить свое генеалогическое древо биология
  • Как найти клад на болоте