# sending files to sftp in remote windows from ansible

**URL:** <https://forum.ansible.com/t/sending-files-to-sftp-in-remote-windows-from-ansible/24348>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [April 28, 2017, 8:38am UTC](https://forum.ansible.com/t/sending-files-to-sftp-in-remote-windows-from-ansible/24348 "2017-04-28T08:38:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![acharya\_tejaswi\_indu](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@acharya\_tejaswi\_indu](https://forum.ansible.com/u/acharya_tejaswi_indu)\
**Post date:** [April 28, 2017, 8:38am UTC](https://forum.ansible.com/t/sending-files-to-sftp-in-remote-windows-from-ansible/24348/1 "2017-04-28T08:38:25Z")

</div>

Hii,

I am trying to transfer my files from ansible linux to sftp server.

1. How to add sftp host in my ansible host file.
2. I had added scp\_if\_ssh=False in [ssh-connection] in ansible.cfg
3. This sftp server not have any ssh where i have only sftp connectivity.
4. Is there any way to connect ansible to sftp and the port using here is 4222
5. In the host file i added host in this way as below

[sftp]  
[sftp.exampletest.com](http://sftp.exampletest.com) ansible\_port=4222

The error is

root@sgplubuntu125:/etc/ansible/playbooks# ansible sftp -m ping  
[sftp.exampletest.com](http://sftp.exampletest.com) | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “Failed to connect to the host via ssh: command-line line 0: Missing argument.\r\n”,  
“unreachable”: true  
}

can anyone help me please

Thanks,
