# I want auto script,but something error

**URL:** <https://forum.ansible.com/t/i-want-auto-script-but-something-error/24336>\
**Category:** Ansible Project\
**Created:** [April 27, 2017, 3:57am UTC](https://forum.ansible.com/t/i-want-auto-script-but-something-error/24336 "2017-04-27T03:57:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user109](https://avatars.discourse-cdn.com/v4/letter/u/b9e5f3/32.png) [@user109](https://forum.ansible.com/u/user109)\
**Post date:** [April 27, 2017, 3:57am UTC](https://forum.ansible.com/t/i-want-auto-script-but-something-error/24336/1 "2017-04-27T03:57:35Z")

</div>

my centos deny remoteroot login and how can i improve  
it my code

- hosts: 192.168.30.75

remote\_user" chtadm  
become: true  
become\_user: root  
tasks:  
copy:  
src: /tmp/kevin/test  
dest:/tmp  
owner:root  
group:root  
mode:0744

it’s my ansbile-vault  
192.168.30.75 remote\_user=root remote\_pass=1qaz@WSX

and i input ansible-playbook test.yml --ask-vault-pass  
display error:  
the error appears to have been in ‘/tmp/kevin/test.yml’ : line 3,column 3,but may be elsewhere in the file depending on the exact syntax problem.

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [May 2, 2017, 7:13am UTC](https://forum.ansible.com/t/i-want-auto-script-but-something-error/24336/2 "2017-05-02T07:13:47Z")

</div>

The error is probably because of this line:

&nbsp;&nbsp;remote\_user" chtadm

But you should turn off the remote\_user: root in the vault if  
you don't want to SSH directly as root.

---

<div class="post-metadata">

**Author:** ![user109](https://avatars.discourse-cdn.com/v4/letter/u/b9e5f3/32.png) [@user109](https://forum.ansible.com/u/user109)\
**Post date:** [May 10, 2017, 2:35pm UTC](https://forum.ansible.com/t/i-want-auto-script-but-something-error/24336/3 "2017-05-10T14:35:32Z")

</div>

Hi Davies:  
thanks，i cant direct use root，because my linux policy is permitrootlogin no !!

Best Regards!!

王慧勳於 2017年5月2日星期二 UTC+8上午2時20分48秒寫道：

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [May 10, 2017, 3:22pm UTC](https://forum.ansible.com/t/i-want-auto-script-but-something-error/24336/4 "2017-05-10T15:22:05Z")

</div>

Yes, but this :

192.168.30.75 remote\_user=root remote\_pass=1qaz@WSX

says to login directly as root, so don't do that.

The error is

remote\_user" chtadm

instead of

remote\_user: chtadm
