# trying to create new user on remote machines

**URL:** <https://forum.ansible.com/t/trying-to-create-new-user-on-remote-machines/36864>\
**Category:** Ansible Project\
**Created:** [July 18, 2022, 2:53pm UTC](https://forum.ansible.com/t/trying-to-create-new-user-on-remote-machines/36864 "2022-07-18T14:53:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [July 18, 2022, 2:53pm UTC](https://forum.ansible.com/t/trying-to-create-new-user-on-remote-machines/36864/1 "2022-07-18T14:53:29Z")

</div>

I got following task to create remote user but I do not have ssh keys setup on root or any user. what can i do to create the user? I dont have the become password

# tasks file for createuser

- include\_vars:  
dir: vars

- name: create user rke  
ansible.builtin.user:  
name: ‘{{ username }}’  
shell: ‘{{ shell }}’  
generate\_ssh\_key: yes  
create\_home: yes  
groups: ‘{{ groupname }}’  
append: yes  
ssh\_key\_file: .ssh/id\_rsa  
become: true

- name: create public key  
ansible.builtin.shell:  
cmd: “{{ command }}”  
register: shell\_output  
become: true

- name: Change authorized keys permissions  
ansible.builtin.file:  
path: “{{ authorized\_key\_path }}”  
owner: “{{ username }}”  
group: “{{ username }}”  
mode: ‘600’  
become: true

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [July 18, 2022, 4:04pm UTC](https://forum.ansible.com/t/trying-to-create-new-user-on-remote-machines/36864/2 "2022-07-18T16:04:32Z")

</div>

Impossible. Refuse the task.
