0

I am trying to use ansible to configure a raspberry pi 3A+ with raspbian 10. It is only copying files into a directory. Each time I reinstall, it seems to work for a while, and then stop working.

When it stops working, the minimal problem is that ssh raspberrypi works but ssh raspberrypi "echo HELLO" hangs forever. I took this suggestion https://stackoverflow.com/a/53398252 and ssh -t raspberrypi "echo HELLO" works!

So I am going to try to make ansible do that. However, I am still trying to figure out why it works for a minutes or hours on a new installation and then stops working. I can run the remote command without -t on all my other devices.

Here is the output when it hangs:

ssh raspberrypi "echo HELLO"
...
debug1: Remote: /home/pi/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /home/pi/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending env LC_ALL = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending command: echo HELLO
debug2: channel 0: request exec confirm 1
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768

actually here is some of -vvv:

debug3: Ignored env _
debug1: Sending command: echo TEST
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768

I have been trying to find out more about what -t does to figure out what could have changed.

My other raspberry pi where remote commands work even work like this ssh raspberrypi -T "echo TEST" and I think -T does the opposite of -t...

Also this is what is happening on the raspberry pi that hangs when you try to ssh commands to it:

$ ps aux | grep ssh
root       613  0.0  1.5  10728  5628 ?        Ss   06:05   0:00 /usr/sbin/sshd -D
root       673  0.0  1.6  12240  6316 ?        Ss   06:06   0:00 sshd: pi [priv]
pi         690  0.0  0.9  12240  3516 ?        S    06:06   0:00 sshd: pi
root       691  0.0  1.6  12240  6340 ?        Ss   06:06   0:00 sshd: pi [priv]
pi         697  0.0  0.9  12240  3528 ?        S    06:06   0:00 sshd: pi
root      1005  0.0  1.6  12240  6320 ?        Ss   06:17   0:00 sshd: pi [priv]
pi        1011  0.0  0.9  12240  3512 ?        S    06:17   0:00 sshd: pi
root      1081  2.8  1.6  12240  6308 ?        Ss   06:27   0:00 sshd: pi [priv]
pi        1087  0.2  0.9  12240  3508 ?        S    06:27   0:00 sshd: pi@pts/0
pi        1103  0.0  0.1   4784   504 pts/0    S+   06:28   0:00 grep --color=auto ssh

even long after (one of those is my current connection, but I guess the rest are still trying to echo TEST)

0

If it's any help to anybody, restarting my router fixed the problem:

debug1: Sending command: echo TEST
debug2: channel 0: request exec confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
debug2: channel 0: rcvd ext data 69
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
debug2: channel 0: written 69 to efd 6
debug3: receive packet: type 96
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: chan_shutdown_read (i0 o1 sock -1 wfd 4 efd 6 [write])
debug2: channel 0: input open -> closed
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
TEST

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.