Category Archives: Mac

How To Set Up SSH Keys

Step One—Create the RSA Key Pair

ssh-keygen -t rsa

Step Two—Store the Keys and Passphrase

Enter file in which to save the key (/home/demo/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):

Step Three—Copy the Public Key

ssh-copy-id user@123.45.56.78

Alternatively, you can paste in the keys using SSH:

cat ~/.ssh/id_rsa.pub | ssh user@123.45.56.78 "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"

Optional Step Four—Disable the Password for Root Login

sudo nano /etc/ssh/sshd_config

Within that file, find the line that includes PermitRootLogin and modify it to ensure that users can only connect with their SSH key:

PermitRootLogin without-password

Put the changes into effect:

reload ssh

Source: https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys–2

Osx: Set Brew behind proxy server

First, set up http and https proxy server for Brew:

http_proxy=https://user:password@proxy:port https_proxy=https://user:password@proxy:port brew install PACKAGE

Then, set up proxy for Git, used by Brew.

git config --global http.proxy https://user:password@proxy:port

To reset configuration to its initial values:

git config --global --unset http.proxy