$ mkdir -p ~
$ cd ~/.ssh
$ ssh-keygen -f keyname-identity -P '' -t rsa1
2. Allowing Password less Login on remote-machine.
Copy your public key on remote-machine.
$ scp keyname-identity.pub remote-machine:./.ssh/authorized_keys
Edit authorized_keys on remote-machine
Please place this line before your public key
in the authorized_keys file content
from="local-machine",no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="ls -la" 2048 35 1383...
3. Please make your private key secure.!! Caution !!
$ chmod 511 ~
$ chmod 400
Putting a password less key in a file is exactly like writing a password on a piece of paper. A person who can access to your key file can do whatever you can do with the key.