Skip to content

Instantly share code, notes, and snippets.

@sandheepg
Last active March 8, 2017 06:12
Show Gist options
  • Select an option

  • Save sandheepg/f01a5bf5202a6ad60784dd2d7b8a97cf to your computer and use it in GitHub Desktop.

Select an option

Save sandheepg/f01a5bf5202a6ad60784dd2d7b8a97cf to your computer and use it in GitHub Desktop.
SSH without password

To access remote machine using SSH

> ssh user@remote-host
> enter password when prompted

To get rid of entering password everytime you try to access, SSH keys has to be exchanged between local machine and remote server.

> ssh-keygen [Enter] [Enter] [Enter]
# to generate ssh key if you don't have one already in ~/.ssh
> ssh-copy-id -i ~/.ssh/id_rsa.pub user@remote-host
# copy the generated ssh public key to the remote host
> ssh user@remote-host
# next time you can access the remote box using SSH you will not be prompted with password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment