Linux系统登录欢迎辞


Linux系统登录欢迎辞
 
/etc 文件夹中有两个配置文件 issue 和 issue.net,用于文本设备登录系统时显示的欢迎辞的格式。
issue 是本地,不用多说,issue.net 肯定就是远程啦!
 
这两个文件允许使用转义序列(escape sequence),当系统遇到escape sequence的时候会自动替换成相应的信息,比如:\n 代表主机名。
完整的转移序列列表如下(此列表摘自:man agetty,因为此issue由agetty负责解释):
b    Insert the baudrate of the current line. 
d    Insert the current date. 本地端的当前日期
s    Insert the system name, the name of the operating system. 操作系统的名称
l    Insert the name of the current tty line. 显示第几个终端机的接口
m    Insert the architecture identifier of the machine, eg. i486. 显示硬件的等级(i386/i486/i586/i686....)
n    Insert the nodename of the machine, also known as the hostname. 显示主机的网络名称
o    Insert the NIS domainname of the machine. 显示 domain name
O    Insert the DNS domainname of the machine. 
r    Insert the release number of the OS, eg. 1.1.9. 操作系统的发行版本 (类似 uname-r)
t    Insert the current time. 本地端的当前时间
u    Insert the number of current users logged in. 登录的用户数量
U    Insert the string "1 user" or "<n> users" where <n> is the number of current users logged in. 
v    Insert the version of the OS, eg. the build-date etc.操作系统的版本
 
CentOS 中,两个文件的内容一致,如下:
CentOS release 6.1 (Final)
Kernel \r on an \m
 
系统登录成功后的欢迎辞则是:/etc/motd,“motd”是“Message Of ToDay”的缩写,通常这个文件是空的。
* 在 CentOS 6.4 下,motd 文件好像不支持转义序列。
我们可以通过配置这个文件在用户登录成功之后,跟当前用户打个招呼:“Hello, welcome back!”,也可以警告一下对系统图谋不轨的“坏家伙”。
 
通过配置这两个文本,可以定制登录时的个性化信息,如果再配上脚本来处理,就可以实现动态的显示更多内容,比如说时间提醒、系统公告等,那就更有意思了!
 

相关内容

    暂无相关文章