- Change directory to your
.ssh
directory. (ie.cd ~/.ssh
) - Create the key pair. (ie.
ssh-keygen -N "" -f hello_world
) - Add the key to the
authorized_keys
file along with the command. (ie.echo -n 'command="echo Hello World"' | cat - hello_world.pub >> authorized_keys
) - Try it out! (ie.
SSH_AUTH_SOCK=/dev/null ssh -o BatchMode=true -qi hello_world localhost
)
§
No comments:
Post a Comment