$ mkdir -p ~
/.ssh$ 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 contentfrom="
local_machine
",no-pty,no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command="remote_command
_you_want_to_execute_on_local-machine"
For example:
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 ~/.ssh
$ chmod 400~
/.ssh/keyname
-identity
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.
No comments:
Post a Comment