question

henrik avatar image
henrik asked

"ILLEGAL ROOT LOGIN" and available TTYs for SSH

I had a problem using SSH through tailscale which only happened from time to time:

Dec 21 09:13:48 raspberrypi2 authpriv.crit login[3400]: ILLEGAL ROOT LOGIN  on '/dev/pts/4' from '100.117.71.145'

After weeks of scratching my head I finally figured out it was because /etc/securetty had a limited amount of pts entries:

$ grep pts /etc/securetty
pts/0
pts/1
pts/2
pts/3

Adding some more fixed the issue:

$  echo 'pts/4
pts/5
pts/6
pts/7' >> /etc/securetty

I suspect this might be the root cause for not being able to access the VRM console from time to time too, since it seemed to happen at the same time of a tailscale ssh login.

Would it be possible add these in the stock image too? Should I create a PR for it, @mvader (Victron Energy) ?

Venus OSssh
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
henrik avatar image
henrik answered ·

I currently use a workaround for this in case anyone is interested:

/data/rc.local

#!/bin/bash

/data/home/root/bin/fix-securetty

exit 0

/data/home/root/bin/fix-securetty

#!/bin/bash

add_ttys() {
  mount -o remount,rw /
  chmod u+w /etc/securetty
  echo 'pts/4
pts/5
pts/6
pts/7
pts/8
pts/9' >> /etc/securetty
  echo pts fixed
  chmod u-w /etc/securetty
  mount -o remount,ro /
}

grep -q pts/4 /etc/securetty && echo pts already in place || add_ttys

exit 0
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

henrik avatar image
henrik answered ·

Added a PR for this: https://github.com/victronenergy/meta-victronenergy/pull/23

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

henrik avatar image
henrik answered ·

This has now been merged to master: https://github.com/victronenergy/meta-victronenergy/commit/981a6037f15e6e26d8b4eb765fae08ab3e74d284

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.