Linux

Login with an ssh key

Contents

Set up an ssh key on macOS so you can log into the server without typing a password
Normally I don’t do this, for security.

macOS

- Generate a key

1
ssh-keygen -t rsa -C "name"

- View the public key

1
cat ~/.ssh/id_rsa.pub

Target Server (CentOS)

- Add the public key to the ~/.ssh/authorized_keys file

1
vi ~/.ssh/authorized_keys