Pi-Star SSH Terminal fails to load after update

General support for the Pi-Star System
User avatar
K1IMD
Posts: 6
Joined: Thu Apr 12, 2018 2:42 am
Location: Long Island, NY USA

Pi-Star SSH Terminal fails to load after update

Post by K1IMD » Wed Dec 05, 2018 2:01 am

I have built several mmdvm repeaters. Initially, I did not use Pi-Star but as the numbers increased it became "safer" use Pi-Star verses CLI.

In any event, this has happened to a few times which I find a little frustrating. At some point after an update the onboard SSH Terminal Access fails to load. The SSH server is working fine because using another PC I can log in without a problem. The SSH Terminal window is all white and non-responsive and full screen or window does not respond. After this happens the only way to restore the SSH Terminal Access is to create another image and start over.

Has this happened to anyone else? If so, is there a simple fix without having to create another image? I do use the terminal to edit the firewall & Static IP address. Lots handier not to have to fire up a SSH client.

73
Jon
K1IMD
73!
K1IMD

w7efs
Posts: 96
Joined: Sun Apr 22, 2018 4:26 pm

Re: Pi-Star SSH Terminal fails to load after update

Post by w7efs » Wed Dec 05, 2018 6:42 pm

K1IMD wrote:
Wed Dec 05, 2018 2:01 am
... I do use the terminal to edit the firewall & Static IP address. ...
http://wiki.pistar.uk/Adding_custom_fir ... to_Pi-Star

User avatar
K1IMD
Posts: 6
Joined: Thu Apr 12, 2018 2:42 am
Location: Long Island, NY USA

Re: Pi-Star SSH Terminal fails to load after update

Post by K1IMD » Fri Dec 07, 2018 2:32 am

Not sure what this response is for it is not about the problem posted.

I have no problem accessing the ssh server with an ssh client... The problem is the ssh terminal built into pi-star does not run when executed from the menu. Just a blank white window after an upgrade or series of upgrades.

Jon
K1IMD
73!
K1IMD

AF6VN
Posts: 76
Joined: Fri Jul 20, 2018 1:15 am

Re: Pi-Star SSH Terminal fails to load after update

Post by AF6VN » Sat Dec 08, 2018 5:37 pm

Try clearing your browser's cache and reloading the page.

--
AF6VN
Dennis L Bieber

User avatar
K1IMD
Posts: 6
Joined: Thu Apr 12, 2018 2:42 am
Location: Long Island, NY USA

Re: Pi-Star SSH Terminal fails to load after update

Post by K1IMD » Sun Dec 09, 2018 1:58 am

Thanks AF6VN,

Yeah I tried that... changed browsers too. No Joy!

Attached is a screen grab of the ssh window that is blank. Attempting to open the full screen windows does not work either.

73
Jon
K1IMD
Attachments
Capture.JPG
Capture.JPG (65.49 KiB) Viewed 116 times
73!
K1IMD

AF6VN
Posts: 76
Joined: Fri Jul 20, 2018 1:15 am

Re: Pi-Star SSH Terminal fails to load after update

Post by AF6VN » Sun Dec 09, 2018 9:16 pm

Just a last silly thought (since you seem to have an edited color scheme; mine is still the red scheme) have you confirmed that you don't have something like white text on a white background?

My next approach would be to use something like WireShark to capture network packets sent/received when you attempt to open the SSH.

I don't normally use that panel -- I have much more capability with PuTTY (among other things, I have PuTTY configured to automatically capture each session to a time-stamped log file [hmmm, time to clean out old logs]).

--
AF6VN
Dennis L Bieber

M0GLJ
Posts: 118
Joined: Thu Apr 05, 2018 2:48 am
Location: United Kingdom
Contact:

Re: Pi-Star SSH Terminal fails to load after update

Post by M0GLJ » Sun Dec 09, 2018 9:33 pm

As part of the testing team, I have today flashed a new card and updated from the dashboard. I entered all relevant details to get Pi-Star on air and have had no problems accessing the SSH part of the expert dashboard.

Therefore you have done something of changed something either in your Pi-Star or on the computer you use to access Pi-Star.

Go and have a look at what you have changed and then you can correct the mistake you have made
Adrian
M0GLJ

Pi-Star Marketing Director - Pi-Star Administrator - Pi-Star Beta Tester

ZUMradio ■ ZUMspot ■ DV-Mega

D-star --> IC-E92D
DMR --> DM-4600 ■ DM-4601 ■ MD-380 ■ RT-82
DAPNET --> Alphapoc 602R

N4NQY
Posts: 12
Joined: Thu Apr 12, 2018 5:47 pm

Re: Pi-Star SSH Terminal fails to load after update

Post by N4NQY » Mon Dec 10, 2018 3:43 pm

I encountered this problem for the first time today and found this thread when searching for a solution. The system was running fine last night and I used SSH to do a "pistar-update" and "pistar-upgrade", which completed properly. Eight hours later SSH is not working. Maybe a failed overnight update??

I run the red color scheme. I have run Pi-Star since the very first version. I have 4 Pi's with Pi-Star running (each of 3 hotspots with a separate Mode on each and 1 as a portable repeater). Right now there is only one of them experiencing this problem. It is a Duplex board Hotspot, running DMR only, at the moment.

When I try to engage the internal SSH client on Safari, I get the blank screen. When using Chrome, I get the blank screen but a messaged that says "refuses to connect". Rebooting the Pi results in the same behavior. I can connect to Pi-star using the Mac's built-in SSH client and run update/upgrade normally with the expected results but no change in the internal SSH client's behavior.

It appears the SSH client is at fault, since the server is acting normally. There appears no graceful way to recover. It would be nice if the Expert mode had a link that would reinstall (recover) some of the more critical components such as Dashboard, SSH Client, WiFI, etc or even forcing a rebuild of the software while retaining the configuration data. This would keep from having to burn new SD cards when there is a bad, or failed, update, etc. Every new SD card becomes a difficult task now since with the need to change "TX" and "RX" offsets, regenerate BM API keys, Change delays, etc., etc. it is not a trivial task to redo an SD card. Even if you back up a configured card, there are constant changes that occur. I am not sure how much of the configuration actually gets backed up with the "Backup" command but I am going to dig into it now....

At this point, unless an additional problem arises, I will wait to see if an upgrade to the SSH client is pushed and fixes the problem, or someday perhaps I will burn a new card and hope the problem goes away.

User avatar
KE0FHS
Posts: 360
Joined: Wed Apr 11, 2018 8:40 pm
Location: Colorado, USA
Contact:

Re: Pi-Star SSH Terminal fails to load after update

Post by KE0FHS » Mon Dec 10, 2018 6:07 pm

Suggest you re-run both the Pi-Star Update and Pi-Star Upgrade processes via an external SSH client like Termius or PuTTY, that gives you the most complete update and possibly might correct any issues that occurred with a previous update.
sudo pistar-update
sudo pistar-upgrade
73, Toshen, KE0FHS
Playing with Pi-Star (unofficial notes about setting up and using Pi-Star):
http://pi-star.hamnotes.com

w7efs
Posts: 96
Joined: Sun Apr 22, 2018 4:26 pm

Re: Pi-Star SSH Terminal fails to load after update

Post by w7efs » Mon Dec 10, 2018 8:41 pm

I'm going to narratively suggest some diagnostics that you may wish to consider, as something has changed on that RPi, as suggested by Adrian. The '#' indicates the root prompt, but one can use sudo as an ordinary user if one prefers.
N4NQY wrote:
Mon Dec 10, 2018 3:43 pm
... The system was running fine last night and I used SSH to do a "pistar-update" and "pistar-upgrade", which completed properly. Eight hours later SSH is not working. Maybe a failed overnight update??

Code: Select all

# tail /var/log/unattended-upgrades/unattended-upgrades.log
2018-12-09 03:48:42,826 INFO Initial blacklisted packages:
2018-12-09 03:48:42,829 INFO Starting unattended upgrades script
2018-12-09 03:48:42,829 INFO Allowed origins are: ['o=Raspbian,n=jessie']
2018-12-09 03:49:04,654 INFO Packages that are auto removed: ''
2018-12-09 03:49:04,655 INFO No packages found that can be upgraded unattended
2018-12-10 03:55:21,013 INFO Initial blacklisted packages:
2018-12-10 03:55:21,016 INFO Starting unattended upgrades script
2018-12-10 03:55:21,017 INFO Allowed origins are: ['o=Raspbian,n=jessie']
2018-12-10 03:55:42,258 INFO Packages that are auto removed: ''
2018-12-10 03:55:42,260 INFO No packages found that can be upgraded unattended
...
When I try to engage the internal SSH client on Safari, I get the blank screen. When using Chrome, I get the blank screen but a messaged that says "refuses to connect". Rebooting the Pi results in the same behavior. I can connect to Pi-star using the Mac's built-in SSH client and run update/upgrade normally with the expected results but no change in the internal SSH client's behavior.
To which port is your Macintosh ssh client connecting ... port 22? That's the default port on which /usr/sbin/sshd listens; you may have (hopefully) changed that port to something else in /etc/ssh/sshd_config, but if you did then you're certainly aware of the firewall maintenance considerations that I previously suggested to the OP.
It appears the SSH client is at fault, since the server is acting normally.
It's important to understand that the web-based "SSH client" does not use "the server" /usr/sbin/sshd, but rather a package known as "shellinabox". There are several ways to observe on which port it's listening. The port :2222 in the "Expert" URL is what the web-based client is attempting, but let's look at a few things on the Pi-Star box to verify that it's actually listening on that port. In this example, there's a user login from IP address w.x.y.z. The "-p 2222" argument on the two /usr/bin/shellinaboxd lines are what we're looking for :

Code: Select all

# systemctl status shellinabox
● shellinabox.service - LSB: Shell In A Box Daemon
   Loaded: loaded (/etc/init.d/shellinabox)
   Active: active (running) since Wed 2018-12-05 13:32:02 PST; 4 days ago
  Process: 873 ExecStart=/etc/init.d/shellinabox start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/shellinabox.service
           ├─  951 /usr/bin/shellinaboxd -q --background=/var/run/shellinaboxd.pid -c /var/lib/shellinabox -p 2222 -u shellinabox -g shellinabox --user-css W...
           ├─  952 /usr/bin/shellinaboxd -q --background=/var/run/shellinaboxd.pid -c /var/lib/shellinabox -p 2222 -u shellinabox -g shellinabox --user-css W...
           ├─25863 login -p -h w.x.y.z
           └─26052 -bash

Dec 05 13:32:02 hostname systemd[1]: Starting LSB: Shell In A Box Daemon...
Dec 05 13:32:02 hostname systemd[1]: Started LSB: Shell In A Box Daemon.

Code: Select all

# cat /etc/default/shellinabox
# Should shellinaboxd start automatically
SHELLINABOX_DAEMON_START=1

# TCP port that shellinboxd's webserver listens on
SHELLINABOX_PORT=2222

# Parameters that are managed by the system and usually should not need
# changing:
# SHELLINABOX_DATADIR=/var/lib/shellinabox
# SHELLINABOX_USER=shellinabox
# SHELLINABOX_GROUP=shellinabox

# Any optional arguments (e.g. extra service definitions).  Make sure
# that that argument is quoted.
#
#   Beeps are disabled because of reports of the VLC plugin crashing
#   Firefox on Linux/x86_64.
SHELLINABOX_ARGS="--no-beep --disable-ssl-menu --disable-ssl --css=/etc/shellinabox/options-enabled/00_White\ On\ Black.css"
Let's have a look at the firewall to make sure the above "SHELLINABOX_PORT=2222" is allowed through:

Code: Select all

# iptables -L | grep 2222
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:2222
And a quick peek at the log entries:

Code: Select all

# grep -ri shellinabox /var/log/*
/var/log/auth.log:Dec 10 11:21:29 hostname login[25863]: pam_unix(login:session): session opened for user pi-star by SHELLINABOX(uid=0)
... I am not sure how much of the configuration actually gets backed up with the "Backup" command but I am going to dig into it now....
...

Code: Select all

$ unzip -l Pi-Star_Config_10-Dec-2018.zip
Archive:  Pi-Star_Config_10-Dec-2018.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      535  2018-12-10 10:05   RSSI.dat
      959  2018-12-10 10:05   config.php
      294  2018-12-10 10:05   dapnetgateway
     1253  2018-12-10 10:05   dmrgateway
       27  2018-12-10 10:05   dstar-radio.mmdvmhost
     2373  2018-12-10 10:05   dstarrepeater
        6  2018-12-10 10:05   hostname
      146  2018-12-10 10:05   hosts
     2956  2018-12-10 10:05   ircddbgateway
      410  2018-12-10 10:05   ircddblocal.php
     2489  2018-12-10 10:05   mmdvmhost
      388  2018-12-10 10:05   p25gateway
      704  2018-12-10 10:05   pistar-remote
     1233  2018-12-10 10:05   starnetserver
      124  2018-12-10 10:05   timeserver
       96  2018-12-10 10:05   wpa_supplicant.conf
      794  2018-12-10 10:05   ysf2dmr
      845  2018-12-10 10:05   ysfgateway
---------                     -------
    15632                     18 files
Hopefully the above commands and further consideration will give you some better understanding of what's happening with the rogue web-based connection attempts.

Post Reply