The net is full of suggestions e.g. 
https://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch
With that:
  [[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive' >> 
/tmp/update-motd-test
  shopt -q login_shell && echo 'Login shell' || echo 'Not login shell' >> 
/tmp/update-motd-test
In a test like:
  ssh [email protected] "ls ~/"
It will detect:
  Not interactive
  Not login shell

If not in libpam we could clearly use this in the script snippets to fast-pass 
most of them.
Sadly above checks seem trivial I've found that they always report 
non-interactive/non-login even when being such. It seems the way this is 
executed prevents proper detection.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1893716

Title:
  scripts in /etc/update-motd.d/ run even on login via non-interactive
  scp and sftp sessions

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-motd/+bug/1893716/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to