# Unable to git clone on Windows host via win\_shell/win\_command

**URL:** <https://forum.ansible.com/t/unable-to-git-clone-on-windows-host-via-win-shell-win-command/31594>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [November 5, 2019, 12:25am UTC](https://forum.ansible.com/t/unable-to-git-clone-on-windows-host-via-win-shell-win-command/31594 "2019-11-05T00:25:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benjamin\_Metzler](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@Benjamin\_Metzler](https://forum.ansible.com/u/Benjamin_Metzler)\
**Post date:** [November 5, 2019, 12:25am UTC](https://forum.ansible.com/t/unable-to-git-clone-on-windows-host-via-win-shell-win-command/31594/1 "2019-11-05T00:25:02Z")

</div>

Hi All,  
I’m hitting a wall wrt to win\_shell and a “git clone”. I am trying to use win\_shell to clone a git repo w/o success. I am getting the below error.

`  
Using module file /home/user/.local/lib/python2.7/site-packages/ansible/modules/windows/win\_shell.ps1  
Pipelining is enabled.  
\<\<HOST\_NAME\>\> ESTABLISH PSRP CONNECTION FOR USER: ON PORT 5985 TO \<HOST\_NAME\>  
\<\<HOST\_NAME\>\> PSRP OPEN RUNSPACE: auth=negotiate configuration=Microsoft.PowerShell endpoint=http://\<HOST\_NAME\>:5985/wsman  
PSRP: EXEC (via pipeline wrapper)  
\<\<HOST\_NAME\>\> PSRP RC: 0  
\<\<HOST\_NAME\>\> PSRP STDOUT: {“start”:“2019-11-04 11:56:37.380685”,“stdout”:“”,“cmd”:“git clone [https://example.com/scm/project/tools.git",“msg”:"non-zero](https://example.com/scm/project/tools.git%22,%22msg%22:%22non-zero) return code”,“stderr”:“Cloning into \u0027tools\u0027…\nLogon failed, use ctrl+c to cancel basic credential prompt.\r\nbash: /dev/tty: No such device or address\nerror: failed to execute prompt script (exit code 1)\nfatal: could not read Username for \u0027https://example.com\u0027: tools error”,“changed”:true,“rc”:1,“failed”:true,“delta”:“0:00:01.984372”,“end”:“2019-11-04 11:56:39.365057”}  
\<\<HOST\_NAME\>\> PSRP STDERR:  
\<\<HOST\_NAME\>\> PSRP CLOSE RUNSPACE: 26C4A0F7-D74B-4E23-9CBA-02C47DAD8A8E  
fatal: [\<HOST\_NAME\>]: FAILED! =\> {  
“changed”: true,  
“cmd”: “git clone [https://example.com/scm/project/tools.git](https://example.com/scm/project/tools.git)”,  
“delta”: “0:00:01.984372”,  
“end”: “2019-11-04 11:56:39.365057”,  
“msg”: “non-zero return code”,  
“rc”: 1,  
“start”: “2019-11-04 11:56:37.380685”,  
“stderr”: “Cloning into ‘tools’…\nLogon failed, use ctrl+c to cancel basic credential prompt.\r\nbash: /dev/tty: No such device or address\nerror: failed to execute prompt script (exit code 1)\nfatal: could not read Username for ‘[https://example.com](https://example.com)’: No tools”,  
“stderr\_lines”: [  
“Cloning into ‘tools’…”,  
“Logon failed, use ctrl+c to cancel basic credential prompt.”,  
“bash: /dev/tty: No such device or address”,  
“error: failed to execute prompt script (exit code 1)”,  
“fatal: could not read Username for ‘[https://example.com](https://example.com)’: No tools”  
],  
“stdout”: “”,  
“stdout\_lines”:   
}

`

My yml file looks like this:  
`

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [November 5, 2019, 10:48am UTC](https://forum.ansible.com/t/unable-to-git-clone-on-windows-host-via-win-shell-win-command/31594/2 "2019-11-05T10:48:16Z")

</div>

By default a network login on Windows does not have the users password available so it cannot take advantage of things that are encrypted with their credentials. This includes things like the Windows credential manager so it’s unable to find the password for your remote URL. You either need to connect with credssp auth or use become on the task with the users explicit credentials to bypass this.

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Benjamin\_Metzler](https://avatars.discourse-cdn.com/v4/letter/b/cc9497/32.png) [@Benjamin\_Metzler](https://forum.ansible.com/u/Benjamin_Metzler)\
**Post date:** [November 5, 2019, 4:18pm UTC](https://forum.ansible.com/t/unable-to-git-clone-on-windows-host-via-win-shell-win-command/31594/3 "2019-11-05T16:18:02Z")

</div>

Hi Jordan. Thanks for the information.

I tried CredSSP (and kerberos) and both give me a:

`  
fatal: [\<HOST\_NAME\>]: FAILED! =\> {  
“changed”: false,  
“module\_stderr”: “#\< CLIXML\r\n”,  
“module\_stdout”: “”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1  
}

`

I’ve enabled CredSSP on the agent via:

```auto
Enable-WSManCredSSP -Role Server -Force

```

and I am able to ping with credssp enabled:  
`  
$ ansible all -i hosts -m win\_ping  
\<HOST\_NAME\> | SUCCESS =\> {  
“changed”: false,  
“ping”: “pong”  
}

`

Ben

---

<div class="post-metadata">

**Author:** ![Phong\_Pham](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Phong\_Pham](https://forum.ansible.com/u/Phong_Pham)\
**Post date:** [January 13, 2020, 10:41pm UTC](https://forum.ansible.com/t/unable-to-git-clone-on-windows-host-via-win-shell-win-command/31594/4 "2020-01-13T22:41:27Z")

</div>

I’m using Enable-WSManCredSSP -Role Server -Force  
I’m able to use win\_ping but git clone via Shell still got hang up… Any help is appreciated!
