Skip to content

Instantly share code, notes, and snippets.

@SrivastavaKshitij
Last active April 24, 2017 15:29
Show Gist options
  • Save SrivastavaKshitij/e66ad98c49254cc8248429055a5048fa to your computer and use it in GitHub Desktop.
Save SrivastavaKshitij/e66ad98c49254cc8248429055a5048fa to your computer and use it in GitHub Desktop.
Remote access by typing password only once
This document shows step by step procedure on how to SSH without using password everytime
Type the following commands:
1. cd .ssh
2. vim config
when you open config file, type the following:
host snake
HostName 127.0.0.1
Port 22
user xyz
3. ssh-keygen -t rsa (this is a one time process, when you add other hosts, then you dont need to run this command)
4. ssh xyz@127.0.0.1 mkdir -p .ssh
5. cat .ssh/id_rsa.pub | ssh xyz@127.0.0.1 'cat >> .ssh/authorized_keys'
6. ssh xyz@127.0.0.1
7. ssh snake (this is the step where you dont have to type the password again).
After Step 7 , everytime you type ssh snake it should connect automatically without any prompt for the password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment