Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access and modify a SSH file on mac?

I'm trying to setup SSH on my computer but not sure how to access the ~/.ssh/config file. From github's website they mention this file has to be modified but I'm not sure where its located or how to modify it.

On Github:

If you're using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.

Host *  AddKeysToAgent yes  UseKeychain yes  IdentityFile ~/.ssh/id_rsa 
like image 648
SwiftyJD Avatar asked Jan 10 '19 16:01

SwiftyJD


People also ask

How do I access SSH files on Mac?

To see your . ssh folder in the Finder, press Command+Shift+G, then enter ~/. ssh .

Where is my SSH config file on Mac?

Where is the SSH configuration file? On macOS systems, the configuration file is found at “/private/etc/ssh/ssh_config,” which is symlinked to “/etc/ssh/ssh_config” for compatibility. A second, user-specific ssh_config is found at “~/.

How do I access SSH config?

The ssh program on a host receives its configuration from either the command line or from configuration files ~/. ssh/config and /etc/ssh/ssh_config . Command-line options take precedence over configuration files. The user-specific configuration file ~/.


1 Answers

Start Terminal and create the ~/.ssh directory if it doesn't exist:

mkdir -p ~/.ssh 

Now go into the directory:

cd ~/.ssh 

Now open the file config with the default editor:

open -t config 

If it says that file doesn't exist, create it with:

touch config 

and try opening again:

open -t config 

When you edit the file, make sure it is "Plain Text" using the menu at the top of the screen and clicking Format->Make Plain Text.

Set the permissions as instructed in your tutorial.

like image 168
Mark Setchell Avatar answered Sep 20 '22 08:09

Mark Setchell