ssh does not return proper exit codes. My routers are 380.59 except for the new one which is 380.70. The old fw has even quite unbelivable extra ssh bug!
On my network, there is a .2.8 computer and there is no .2.18 one. Meaning: ssh itself fails when .2.18 is the destination. So, I will use that to illustrate the bug.
Dissastrous bug in 380.70! When I do:
We must get 123 back. Right? Yes, we get 123. But if we do:
we must get 255 back because ssh itself failed. Right? Wrong! We get 1 back! Meaning: bug in the ssh (one of several) does not allow us to differentiate if the ssh itself failed or its remote command failed. OK, we can easily work around this. Just saying there is a bug.
It would be nice if someone would test this bug on the current fw, just for fun.
Funny thing happens on my 380.59 routers. OK, this is old fw, it is partiall fixed, I am not complaining, but it is funny! Redirection kills ssh returns completely.
Tnis must return 123. Right? Wrong. It returns 1! Regardles where one places redirection within the command! 380.70 fixed this. Not even my Raspberry Pi at .2.8 with LibreElec 7 (quite old version) with busybox does not have any of these problems.
Irrelevant but: my routers are Asus RT-AC68U and RT-AC56U all with 380.59. my "newer is better" is Asus RT-AC66U_B1 w. fw 380.70. Unfortunatelly, 380.70 creates so much problems with ssh that I am seriously loosing my patience with it.
I am sure someone will say: you idiot, update to the latest firmware! Well, I did jump from 380.59 to 380.70! And as a result I am fightihg with the 380.70 for over a month now. I bought a new router (Asus RT-AC66U_B1 for 80€) which I do not need at all just to try to adapt to "newer is better" fw just to be prepared if one of my production routers drops dead. Old ones work 3 years with no problems I did not handle. ssh on the new one is killing me! So, if I go even newer, I can only be sure that I will have even more new problems to fix and not sure I will be able revert even to 380.70.
Do not get me wrong: I love Asus routers with huge Merlin effort invested. He deserves a monument for his work!
I am off to top up my big wine glass with some Ivan Dolac 2010, since I have some ssh commands in my 3000+ lines ddns-start script which I must rewrite. Very, very complex ones. I am fighting with changing Internet conditions with my provider, and changes are not for the better...
On my network, there is a .2.8 computer and there is no .2.18 one. Meaning: ssh itself fails when .2.18 is the destination. So, I will use that to illustrate the bug.
Dissastrous bug in 380.70! When I do:
Code:
ssh root@192.168.2.8 "exit 123"; echo $?
Code:
ssh root@192.168.2.18 "exit 123"; echo $?
we must get 255 back because ssh itself failed. Right? Wrong! We get 1 back! Meaning: bug in the ssh (one of several) does not allow us to differentiate if the ssh itself failed or its remote command failed. OK, we can easily work around this. Just saying there is a bug.
It would be nice if someone would test this bug on the current fw, just for fun.
Funny thing happens on my 380.59 routers. OK, this is old fw, it is partiall fixed, I am not complaining, but it is funny! Redirection kills ssh returns completely.
Code:
ssh root@192.168.2.8 "exit 123" 2>&- ; echo $?
Tnis must return 123. Right? Wrong. It returns 1! Regardles where one places redirection within the command! 380.70 fixed this. Not even my Raspberry Pi at .2.8 with LibreElec 7 (quite old version) with busybox does not have any of these problems.
Irrelevant but: my routers are Asus RT-AC68U and RT-AC56U all with 380.59. my "newer is better" is Asus RT-AC66U_B1 w. fw 380.70. Unfortunatelly, 380.70 creates so much problems with ssh that I am seriously loosing my patience with it.
I am sure someone will say: you idiot, update to the latest firmware! Well, I did jump from 380.59 to 380.70! And as a result I am fightihg with the 380.70 for over a month now. I bought a new router (Asus RT-AC66U_B1 for 80€) which I do not need at all just to try to adapt to "newer is better" fw just to be prepared if one of my production routers drops dead. Old ones work 3 years with no problems I did not handle. ssh on the new one is killing me! So, if I go even newer, I can only be sure that I will have even more new problems to fix and not sure I will be able revert even to 380.70.
Do not get me wrong: I love Asus routers with huge Merlin effort invested. He deserves a monument for his work!
I am off to top up my big wine glass with some Ivan Dolac 2010, since I have some ssh commands in my 3000+ lines ddns-start script which I must rewrite. Very, very complex ones. I am fighting with changing Internet conditions with my provider, and changes are not for the better...