Rex and ID files

I am trying to set up a fi-ware cloud instance using Rex. What these instances (and probably other OpenStack-based systems) prove is an "identity file," a single private key that you can use to connect to them. I used variations of this:

user "root";
private_key "/home/jmerelo/.ssh/jj-iv.pem";
public_key "/home/one/public/key.dsa";
key_auth;


group fiware => "130.206.x.y";

desc "Install git";
task "git", group => "fiware", sub {
   install "git";
};

      

where the private key is the one provided by fi-ware and the public key is what I was thinking or nothing. If the public key is missing, the error is

[2014-11-30 11:45:45] WARN - Error running task/batch: No public_key file defined. at /home/jmerelo/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/Rex/Task.pm line 621.
 at /home/jmerelo/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/Rex/TaskList/Base.pm line 273.

      

which is quite obvious. But if I try other public keys, the error is:

[2014-11-30 11:48:37] WARN - Error running task/batch: Wrong username/password or wrong key on 130.206.127.211. Or root is not permitted to login over SSH. at /home/jmerelo/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/Rex/TaskList/Base.pm line 273.

      

Using

ssh -i ~/.ssh/jj-iv.pem root@130.206.x.y

      

connects to the instance correctly. Perhaps the question is, "Can Rex use one private key to connect to the host?"

+3


source to share


1 answer


Finally, I generated the public key from the private key using, as suggested in the documentation ,

$ sshkey-gen -y -f /path/to/your/private.key >public.key

      



and then using this public.key in Rexfile

+3


source







All Articles