[ILUGC] Re: Shell script

  • From: Shakthi Kannan <shakthimaan@xxxxxxxxx>
  • To: ilugc@xxxxxxxxxxxxx
  • Date: Tue, 7 Mar 2017 22:18:29 +0530

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: http://www.freelists.org/list/ilugc
ILUGC Web: http://ilugc.in/

Other related posts: