Score:0

Installation with just`sudo apt install shellinabox` results in certificate error. How do I make shellinabox work?

th flag

I have 2 servers which both are running on Ubuntu 18.04.4 LTS.

I managed to install shellinabox on one of them years ago, which automatically generates some files like certificate.pem in /var/lib/shellinabox/. However I can't remember what I did to make the server generate those files.

I run the following commands on the other server, as a tutorial suggests

sudo apt update
sudo apt install shellinabox

there is no certificates and firefox renders this error

The page you are trying to view cannot be shown because the authenticity of the received data could not be verified.

enter image description here

the error page has only one option which is redirected to

https://support.mozilla.org/en-US/kb/secure-connection-failed-firefox-did-not-connect?as=u&utm_source=inproduct

Both servers use the same configuration for shellinabox, which generated by default.

SHELLINABOX_DAEMON_START=1 
SHELLINABOX_PORT=4200 
SHELLINABOX_ARGS="--no-beep"

with the working shellinabox, service shellinabox status gives

● shellinabox.service - LSB: Shell In A Box Daemon
   Loaded: loaded (/etc/init.d/shellinabox; generated)
   Active: active (running) since Mon 2021-10-25 19:53:10 CST; 15h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 943 ExecStart=/etc/init.d/shellinabox start (code=exited, status=0/SUCCESS)
    Tasks: 2 (limit: 2122)
   CGroup: /system.slice/shellinabox.service
           ├─1111 /usr/bin/shellinaboxd -q --background=/var/run/shellinaboxd.pid -c /var/lib/shellinabox -p 4200 -u shellinabox -g shellinabo
           └─1119 /usr/bin/shellinaboxd -q --background=/var/run/shellinaboxd.pid -c /var/lib/shellinabox -p 4200 -u shellinabox -g shellinabo

Oct 25 19:53:09 VM-0-8-ubuntu systemd[1]: Starting LSB: Shell In A Box Daemon...
Oct 25 19:53:10 VM-0-8-ubuntu systemd[1]: Started LSB: Shell In A Box Daemon.
Oct 25 20:35:29 VM-0-8-ubuntu login[8061]: pam_securetty(login:auth): access denied: tty '/dev/pts/1' is not secure !
Oct 25 20:36:05 VM-0-8-ubuntu login[8061]: pam_unix(login:auth): check pass; user unknown
Oct 25 20:36:05 VM-0-8-ubuntu login[8061]: pam_unix(login:auth): authentication failure; logname=SHELLINABOX uid=0 euid=0 tty=/dev/pts/1 ruser

whereas the output from the one that is not working doesn't have the last three lines above, which I guess indicates the something for SSL configuration goes wrong.

How do I make shellinabox work?

JJJohn avatar
th flag
@muru thanks. the error page has only one option which is redirected to https://support.mozilla.org/en-US/kb/secure-connection-failed-firefox-did-not-connect?as=u&utm_source=inproduct
JJJohn avatar
th flag
@muru Thank you! After clicking "accept ..." the error page in OP shows up.
muru avatar
us flag
Hmm, connecting using `curl` gives "Empty reply from server". I guess you'll have to look the logs (if any)
muru avatar
us flag
That doesn't look like an SSL configuration problem at all. It looks like SSL works fine, but after that shellinabox simply fails to do whatever it is supposed to do (probably due to the error logs you see), and so sends on response. Try comparing `/etc/securetty` in both servers.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.