How could I display a custom version at login prompt

ruchir15

New Member


Messages: 18

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 !!!
 

VladiBG

Daemon

Reaction score: 546
Messages: 1,184

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
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,055
Messages: 38,512

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.
 

Trihexagonal

Son of Beastie

Reaction score: 2,313
Messages: 2,885

This is my /etc/motd:

Code:
FreeBSD 12.2-RELEASE-p4 GENERIC 

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