Linux centos 修改 bash登录 欢迎信息/etc/issue

开机后:
CentOS release 5.6 (Final)
Kernel 2.6.18-238.el5 on an i686
这个就是 登录后的欢迎信息。

#cat /etc/issue
CentOS release 5.6 (Final)
Kernel \r on an \m
到底 \r, \m 是什么意思?
#man issue
The  file  /etc/issue is a text file which contains a message or system
identification to be printed before the login prompt.  It  may  contain
various @char and \char sequences, if supported by mingetty(8).

SEE ALSO
mingetty(8), motd(5)
继续
# man mingetty
………
ISSUE ESCAPES
mingetty recognizes the following  escapes  sequences  which  might  be
embedded in the /etc/issue file:
\d     insert current day (localtime),
\l     insert line on which mingetty is running,
\m     inserts machine architecture (uname -m), 机器架构 如:i386 i686
\n     inserts machine’s network node hostname (uname -n),
\o     inserts domain name,
\r     inserts operating system release (uname -r),操作系统的发行版本
\t     insert current time (localtime),
\s     inserts operating system name,
\u     resp.  \U the current number of users which are currently logged
in.  \U inserts “n users”, where as \u only inserts “n”.
那如果想改变 这个欢迎信息,直接编辑 /etc/issue
vi /etc/issue
保存不了,看来得切换root 用户才行
su root
vi /etc/issue
修改 为
CentOS release 5.6 (Final)
Date \d \t
Kernel \r on an \m
:wq
修改 这个东东!
vi /etc/motd
I will shutdown the machine at 8:00am 10th Sep!
:wq
reboot
重启后(未登录)
显示 上面 \etc\issue 里面的内容
(使用ssh)登录后:
I will shutdown the machine at 8:00am 10th Sep!

0 Comments
Leave a Reply