[ILUGC] Re: Shell script

  • From: "Ashwanth Kumar" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "ashwanthkumar" for DMARC)
  • To: ilugc@xxxxxxxxxxxxx
  • Date: Tue, 7 Mar 2017 22:28:05 +0530

+1 for using suggesting Ansible.
It does really pay off to invest in a repeatable infrastructure on the
longer run.

But if you still incest to write things in bash, `cat | awk | xargs ssh`
might be your friend.


On Tue, Mar 7, 2017 at 10:18 PM, Shakthi Kannan <shakthimaan@xxxxxxxxx>
wrote:

Hi,

--- On Tue, Mar 7, 2017 at 9:03 PM, Mohamed Mushab <mushab.mmm@xxxxxxxxx>
wrote:
| Is there any ready script to create new user and add the key into the
| corresponding user.?
\--

Please use automation and deployment tools for such tasks. In Ansible,
for example, you can use the "user" module to accomplish the same.

# Create a 2048-bit SSH key for user jsmith in ~jsmith/.ssh/id_rsa
- user:
    name: jsmith
    generate_ssh_key: yes
    ssh_key_bits: 2048
    ssh_key_file: .ssh/id_rsa

Source: http://docs.ansible.com/ansible/user_module.html

SK

--
Shakthi Kannan
http://www.shakthimaan.com
_____________________________________
ILUGC List: //www.freelists.org/list/ilugc
ILUGC Web: http://ilugc.in/




-- 

Ashwanth Kumar / ashwanthkumar.in


_____________________________________
ILUGC List: //www.freelists.org/list/ilugc
ILUGC Web: http://ilugc.in/

Other related posts: