ansible paramiko fails with failed to open a SFTP connection (Channel closed.)

1,620 views
Skip to first unread message

Asif Iqbal

unread,
Sep 3, 2015, 2:25:44 PM9/3/15
to Ansible Project
Hi All

I am trying to connect to some freebsd server with custom password prompt. So I need to use paramiko since sshpass hangs on custom password prompt.

With -c paramiko now I get the following error...

$ ansible -vvvv -m ping -c paramiko remote
<remote> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO remote
<remote> REMOTE_MODULE ping
<remote> EXEC /bin/sh -c 'mkdir -p /export/home/axisys/.ansible/tmp/ansible-tmp-1441304559.02-141114907172308 && chmod a+rx /export/home/axisys/.ansible/tmp/ansible-tmp-1441304559.02-141114907172308 && echo /export/home/axisys/.ansible/tmp/ansible-tmp-1441304559.02-141114907172308'
<remote> PUT /tmp/tmpPcx8Lk TO /export/home/axisys/.ansible/tmp/ansible-tmp-1441304559.02-141114907172308/ping
remote | FAILED => failed to open a SFTP connection (Channel closed.)

Any suggestion on how to get a workaround.

Thanks

Asif Iqbal

unread,
Sep 9, 2015, 8:36:30 PM9/9/15
to Ansible Project
Still looking for some help .. I still cannot connect to these freebsd servers
 

Asif Iqbal

unread,
Sep 9, 2015, 10:31:46 PM9/9/15
to Ansible Project
Looks like a pull request is pending to make scp default for paramiko instead of sftp


Any suggestion how to make scp default for paramiko? I am using ansible 1.7.1

Matt Martz

unread,
Sep 9, 2015, 10:38:34 PM9/9/15
to ansible...@googlegroups.com
Paramiko does not support SCP to my knowledge, only SFTP.  To use SCP you need to use the ssh transport and set scp_if_ssh.

It sounds to me like you have a busted SFTP configuration.  You might try using SFTP manually to see what happens.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fbee1a9b-8a3a-4056-b200-3ceb12a01366%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Asif Iqbal

unread,
Sep 9, 2015, 10:52:13 PM9/9/15
to Ansible Project


On Wednesday, September 9, 2015 at 10:38:34 PM UTC-4, Matt Martz wrote:
Paramiko does not support SCP to my knowledge, only SFTP.  To use SCP you need to use the ssh transport and set scp_if_ssh.



I cannot use ssh since sshpass hangs on these freebsd custom prompts

I see some discussion on adding scp.py into paramiko

 
It sounds to me like you have a busted SFTP configuration.  You might try using SFTP manually to see what happens.


sftp is not allowed on most of these freebsd systems

 
On Wednesday, September 9, 2015, Asif Iqbal <vad...@gmail.com> wrote:


On Wednesday, September 9, 2015 at 8:36:30 PM UTC-4, Asif Iqbal wrote:


On Thursday, September 3, 2015 at 2:25:44 PM UTC-4, Asif Iqbal wrote:
Hi All

I am trying to connect to some freebsd server with custom password prompt. So I need to use paramiko since sshpass hangs on custom password prompt.

With -c paramiko now I get the following error...

$ ansible -vvvv -m ping -c paramiko remote
<remote> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO remote
<remote> REMOTE_MODULE ping
<remote> EXEC /bin/sh -c 'mkdir -p /export/home/axisys/.ansible/tmp/ansible-tmp-1441304559.02-141114907172308 && chmod a+rx /export/home/axisys/.ansible/tmp/ansible-tmp-1441304559.02-141114907172308 && echo /export/home/axisys/.ansible/tmp/ansible-tmp-1441304559.02-141114907172308'
<remote> PUT /tmp/tmpPcx8Lk TO /export/home/axisys/.ansible/tmp/ansible-tmp-1441304559.02-141114907172308/ping
remote | FAILED => failed to open a SFTP connection (Channel closed.)

Any suggestion on how to get a workaround.

Thanks


Still looking for some help .. I still cannot connect to these freebsd servers
 

Looks like a pull request is pending to make scp default for paramiko instead of sftp


Any suggestion how to make scp default for paramiko? I am using ansible 1.7.1

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.

Matt Martz

unread,
Sep 10, 2015, 7:01:45 AM9/10/15
to ansible...@googlegroups.com
Then it sounds like you know exactly what the problem is.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.


--
Matt Martz
@sivel
sivel.net

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2d3ad2cd-1b16-4611-95e6-beca65afd0e5%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Asif Iqbal

unread,
Sep 10, 2015, 9:52:35 AM9/10/15
to Ansible Project


On Thursday, September 10, 2015 at 7:01:45 AM UTC-4, Matt Martz wrote:
Then it sounds like you know exactly what the problem is.


While waiting on that looks like updating the pam config for pam_unix.so fixes the sshpass hangs
as explained here


auth            required        pam_unix.so             no_warn try_first_pass authtok_prompt=Password:



To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.


--
Matt Martz
@sivel
sivel.net

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages