I am working on a tooltwist staging server using an Amazon Linux Server but I have to always provide my login username and password. How do I access the linux server securely without going through this?


If you are accessing it from a OSx machine do the following. The general principle being that you generate an public key and then take your public key and put it on the remote server.

On your machine

ssh-keygen -t rsa

This should generate a id_rsa.pub file in your ~/.ssh directory. Take the contents of this file and paste it on the ~/.ssh/authorized_keys file.

Some notes to ensure. Both sides should have .ssh and the files under .ssh be with 600 permissions. Or else you will get errors.

  • 1
    Use ssh-copy-id <host> to copy your ssh key to a new server. – Reactormonk Oct 15 '12 at 8:50
  • ssh-copy-id unfortunately is Linux only. If you are on OSx or Windows, need to do it manually. Though it does not come out of the box for OSx, there are some scripts available to install to mimic this. – unixrules Oct 15 '12 at 9:01
  • ... so copy it over from a Linux machine. – Reactormonk Oct 15 '12 at 16:13

ssh with key-pairs, and a locally running ssh-agent.

man ssh-keygen
man ssh-copy-id
man ssh-add

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.