Skip to content

Instantly share code, notes, and snippets.

@mekicha
Last active February 23, 2018 08:08
Show Gist options
  • Select an option

  • Save mekicha/aaa58bfc58b6f3e84c0b224bafc0ee7c to your computer and use it in GitHub Desktop.

Select an option

Save mekicha/aaa58bfc58b6f3e84c0b224bafc0ee7c to your computer and use it in GitHub Desktop.

Ways to copy your ssh keys from local machine to a remote server

  1. ssh-copy-id username@remote_host

  2. cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Add user to sudoers list

For an existing user. sudo usermod -a -G sudo <username>

disable password authentication on server

sudo nano /etc/ssh/sshd_config PasswordAuthentication no sudo service ssh restart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment