How could I display a custom version at login prompt

I have a requirement, to display custom release version (need to change 12.2-Release with a custom version numbering), when a user logged in to the freebsd based custom operating system.

ssh -i xxxxxx.pem root@xx.xxx.xx.xxx
Last login: Mon Mar 8 07:03:16 2021 from xx.xx.xxx.xxx
FreeBSD 12.2-RELEASE mykernel


I understand, I could update the kernel config file to get name of custom kernel at login prompt
.i.e.
Code:
vim ../sys/amd64/conf/GENERIC
       Ident = mykernel

However if I need to change release version to some custom number how could I do it ?
Something like:

ssh -i xxxxxx.pem root@xx.xxx.xx.xxx
Last login: Mon Mar 8 07:03:16 2021 from xx.xx.xxx.xxx
FreeBSD 5.0.0 mykernel


Kindly guide !!!
 
For logins via ssh you can edit /etc/sshd_config and modify the Banner.

Note: you need to restart sshd service after you modify to configuration so the new settings can apply. Then you can disable /etc/motd or edit it to your preferences.

sshd banner is displayed before entering the user password
/etc/motd is displayed after successful login
 
Note that the version in /etc/motd is automatically updated. So you also want to set update_motd="NO" in rc.conf.

If you really want to create a custom version, edit /usr/src/sys/conf/newvers.sh and build from source.
 
This is my /etc/motd:

Code:
FreeBSD 12.2-RELEASE-p4 GENERIC 

                 Unauthorized Access Denied!!!
                           ,          ,
                          /(          )\
                          \\ \\___   / /
                          /- _  `-/  ' !
                          (/\\/ \\ \\   /
                          / /   | `    \
                          O O   ) /    |
                         `-^--'`<     '
                        (_.)  _  )   /
                         `.___/`    /
                           `-----' /
              <----.     __ / __   \\
              <----|====O)))==) \\) /====
              <----'    `--' `.__,' \\
                            |        |
                            \\       /
                      ______( (_  / \\______
                    ,'  ,-----'   |        \\
                    `--{__________)        \\/
 
Back
Top