Ssh With Password Saved

Ssh With Password Saved

Ssh is a very convenient way to remotely command or control other devices. We use ssh to push commits to git server, to access remote server, and even to manipulate the content of our iphones and ipads. However it’s usually distributing to type your long and elusive password every time. Therefore here I would like introduce a way to create a steady relationship between your computer and the remote server you wanna connect with.

The principle is this, ssh connection establishments requires verification using the computer unique key of both devices. in order to simplify this step, we can generate a public key of your computer in advanced and which allows other to identify you. While you put that public key in the remote device as authorized key, you can kinda fast forward the process.

  1. open terminal and run ssh-keygen -t dsa
  2. open .ssh/id_dsa.pub and copy content inside
  3. open new tab in terminal and ssh server
  4. paste all content into ~/.ssh/authorized_keys
ssh-keygen -t rsa  
ssh b@B mkdir -p .ssh  
cat .ssh/id_rsa.pub | ssh b@B ‘cat >> .ssh/authorized_keys’