Centos 7 x64

When I use Teamviewer connect to ttys, I can view infos as below in each Ctrl-Alt-F1 to F6:

CentOS Linux 7 (Core)
Kernel 3.10.0-514.6.1.el7.x86_64 on an x86_64

Openning a physic machine, it should also show these messages.

When I log in I can see:

Last login: Sun Feb 26 21:54:05 on tty1


Well, Where these info from? where to show these info? Read from a configuration file? Run a script? I did not find any related stuff in /etc/profile and ~/.bash_profile.

How do I show my custom infos before login and after login?

Say. The first info which I would like to show is current tty. Is it possible to show this info? how to do that?

Thank you.


Well I now add:

echo "$(whoami) now on tt$(fgconsole)"

in ~/.bash_profile to show custom infos after login.

But what about before login?


I think you can modify /etc/motd, it will print the text contained on every user login.

To change the TTY text which is shown before login, you should modify /etc/issue or /etc/issue.net.

Only for SSH, you can also use Banner option in /etc/ssh/sshd_config to configure custom message for SSH.

Source: http://www.linuxfromscratch.org/blfs/view/svn/postlfs/logon.html https://en.wikipedia.org/wiki/Motd_(Unix)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.