force ssh login through ttyd

This commit is contained in:
Tobias Powalowski 2024-06-18 11:24:32 +02:00
parent 31e2508b0c
commit 457c79620b
2 changed files with 2 additions and 10 deletions

View file

@ -21,10 +21,6 @@ if command -v nvim >/dev/null; then
alias vim='nvim'
alias edit='nvim'
fi
# show MOTD on ttyd login
if [[ -z "${TTY}" && -z "${SSH_TTY}" && -z "${TMUX}" && "$(grep -w 'archboot' /etc/hostname)" ]]; then
[[ "${SHLVL}" == "2" ]] && cat /etc/motd
fi
# run remote-login.sh on ssh connection
if [[ -z "${STY}" && -n "${SSH_TTY}" && "$(grep -w 'archboot' /etc/hostname)" ]]; then
/usr/bin/remote-login.sh

View file

@ -4,12 +4,8 @@
# simulate login from tty on first screen session
if ! screen -ls &>/dev/null; then
if [[ -z "${SSH_TTY}" ]]; then
_LOGIN=ttyd
else
_LOGIN=ssh
clear
fi
LOGIN=ssh
clear
echo -e "\e[1mLogin on ${_LOGIN} | $(uname -r) | $(date)\e[m"
echo ""
cat /etc/motd