Re: [ansible-project] user_module and ssh key

2019-03-22 Thread Sebastian Meyer
On 22.03.19 07:51, Alexander B. wrote:> Hello.
> There are two hosts. On first I create a user and generate SSH keys.
Now I
> need to transfer private key to second host to connect using it to first
> host without creating a user on second. I haven't found an output of
> parameter ssh_key as analogg to ssh_public_key in module user. In other
> modules related to SSH there is only a possibility to see contents of
> public key. What is the reason for this restriction?
Because the private key should be _private_ and not be transferred
around the network.

If you need to be able to login from host2 to host1, you need to
generate a ssh keypair on host2, (either using the user module or
command module), fetch the contents of the public key, and use the
authorized_key module to put the public key into the authorized_keys
file for the user.

>
> The documentation
>  is
> written about the path to the ssh public key. in the example of a private
> key.
>
> ssh_key_file  Path to generated SSH public key file. *Sample*:
> /home/asmith/.ssh/id_rsa
That one is a bug in the docs, it's fixed in the devel docs:

https://docs.ansible.com/ansible/devel/modules/user_module.html

- Sebastian

>
-- 
Sebastian Meyer
Linux Consultant & Trainer
Mail: me...@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fcf44d3a-f871-a37e-f9d8-9674d5a48c79%40b1-systems.de.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] user_module and ssh key

2019-03-21 Thread Alexander B.
Hello. 
There are two hosts. On first I create a user and generate SSH keys. Now I 
need to transfer private key to second host to connect using it to first 
host without creating a user on second. I haven't found an output of 
parameter ssh_key as analogg to ssh_public_key in module user. In other 
modules related to SSH there is only a possibility to see contents of 
public key. What is the reason for this restriction?

The documentation 
 is 
written about the path to the ssh public key. in the example of a private 
key.

ssh_key_file  Path to generated SSH public key file. *Sample*: 
/home/asmith/.ssh/id_rsa

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/97cdbda3-03a5-438d-9fe2-cde60551a5c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.