Login Message: Difference between revisions

From Cramsession
Jump to navigationJump to search
✍️ Verified Author: MflavellClick to view professional profile & credentials
(Created page with "For messages after login: /etc/motd For messages before login: /etc/issue [https://superuser.com/questions/290294/how-to-display-a-message-before-login]")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
For messages after login:
[[Computer Notes]] > [[Linux]] > Login Message
 
 
 
= For messages after login =


  /etc/motd
  /etc/motd




For messages before login:
= For messages before login =


  /etc/issue
  /etc/issue


= Message user must confirm after login =
* cd to '''etc/profile.d'''
* edit ''ssh_confirm.sh''
* Add the following script:
#!/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
        while true; do
                read -p " message - Do you agree? [y/N] " yn
                case $yn in
                        [Yy]* ) break ;;
                        [Nn]* ) exit 1 ;;
                esac
        done
fi


[https://superuser.com/questions/290294/how-to-display-a-message-before-login]
[https://superuser.com/questions/290294/how-to-display-a-message-before-login]

Latest revision as of 18:00, 6 August 2025

Computer Notes > Linux > Login Message


For messages after login

/etc/motd


For messages before login

/etc/issue


Message user must confirm after login

  • cd to etc/profile.d
  • edit ssh_confirm.sh
  • Add the following script:
  1. !/bin/bash
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
       while true; do
               read -p " message - Do you agree? [y/N] " yn
               case $yn in
                       [Yy]* ) break ;;
                       [Nn]* ) exit 1 ;;
               esac
       done
fi

[1]